fix: XTerm Set Scrolling Region

This commit is contained in:
hstyi
2025-07-31 16:50:55 +08:00
committed by hstyi
parent 7243e933e6
commit d249e5da5a

View File

@@ -332,15 +332,16 @@ class ControlSequenceIntroducerProcessor(terminal: Terminal, reader: TerminalRea
var top = sr.getOrElse(0) { 1 }
var bottom = sr.getOrElse(1) { terminalModel.getRows() }
if (bottom <= top || top < 1) {
if (bottom <= top) {
if (log.isWarnEnabled) {
log.warn("Set Scrolling Region Error. top: $top , bottom: $bottom")
}
top = 1
bottom = terminalModel.getRows()
}
top = max(1, top)
bottom = min(terminalModel.getRows(), bottom)
// 设置滚动区域
terminal.getTerminalModel().setData(
DataKey.ScrollingRegion,