fix: correct scrolling region handling in ControlSequenceIntroducerProcessor

This commit is contained in:
hstyi
2025-12-08 14:56:15 +08:00
committed by hstyi
parent 79842f4625
commit bbc64043ed

View File

@@ -332,6 +332,12 @@ class ControlSequenceIntroducerProcessor(terminal: Terminal, reader: TerminalRea
var top = sr.getOrElse(0) { 1 } var top = sr.getOrElse(0) { 1 }
var bottom = sr.getOrElse(1) { terminalModel.getRows() } var bottom = sr.getOrElse(1) { terminalModel.getRows() }
// ";r" https://vt100.net/docs/vt510-rm/DECSTBM.html
if (sr.size == 1 && args.startsWith(';')) {
bottom = top
top = 1
}
if (bottom <= top) { if (bottom <= top) {
if (log.isWarnEnabled) { if (log.isWarnEnabled) {
log.warn("Set Scrolling Region Error. top: $top , bottom: $bottom") log.warn("Set Scrolling Region Error. top: $top , bottom: $bottom")