Fixed(terminal-emulator): Do not scroll the region on RI above the top margin - #5353
Open
matthematics1137 wants to merge 1 commit into
Open
matthematics1137 wants to merge 1 commit into
matthematics1137 wants to merge 1 commit into
Conversation
…p margin Reverse Index (`ESC M`) scrolled the scroll region down whenever the cursor was at or above the top margin. With a top margin below the first line and the cursor above it, the region's content moved down a line (and its last line was lost) while the cursor stayed where it was. Only scroll when the cursor is on the top margin. Above it, RI is a plain cursor up that stops at the first line, as in xterm, tmux and xterm.js. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverse Index (
ESC M) scrolls the scroll region down whenever the cursor isat or above the top margin. When the top margin is below the first line and the
cursor is above it, the region's content moves down a line and its last line is
lost, while the cursor stays where it was.
To reproduce:
xterm, tmux and xterm.js print
Xover the first1and leave lines 3 to 5alone. Termux prints
Xon line 2, and lines 3 to 5 scroll down: line 3 isblank and
555is gone.xterm's
RevIndex()says it directly: "reverse indexing when above scrollingregion is cursor up". This change scrolls only when the cursor is on the top
margin. Above it, RI moves the cursor up and stops at the first line.
Test:
ScrollRegionTest.testRiAboveTopMargin.