diff --git a/src/main/kotlin/app/termora/terminal/ControlSequenceIntroducerProcessor.kt b/src/main/kotlin/app/termora/terminal/ControlSequenceIntroducerProcessor.kt index 6d2c790..4f3c18a 100644 --- a/src/main/kotlin/app/termora/terminal/ControlSequenceIntroducerProcessor.kt +++ b/src/main/kotlin/app/termora/terminal/ControlSequenceIntroducerProcessor.kt @@ -342,7 +342,10 @@ class ControlSequenceIntroducerProcessor(terminal: Terminal, reader: TerminalRea } // 设置滚动区域 - terminal.getTerminalModel().setData(DataKey.ScrollingRegion, ScrollingRegion(top, bottom)) + terminal.getTerminalModel().setData( + DataKey.ScrollingRegion, + ScrollingRegion(top, min(bottom, terminalModel.getRows())) + ) if (log.isDebugEnabled) { log.debug("Set Scrolling Region [${top}; ${bottom}]") @@ -715,6 +718,13 @@ class ControlSequenceIntroducerProcessor(terminal: Terminal, reader: TerminalRea } } + // Alternate Screen Buffer + 47, 1047 -> { + // clear selection + terminal.getSelectionModel().clearSelection() + terminalModel.setData(DataKey.AlternateScreenBuffer, enable) + } + // Alternate Screen Buffer // https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer 1049 -> {