Respect erase attributes (back-color-erase) for scrollDown blank lines - #6035
Open
spokodev wants to merge 1 commit into
Open
Respect erase attributes (back-color-erase) for scrollDown blank lines#6035spokodev wants to merge 1 commit into
spokodev wants to merge 1 commit into
Conversation
scrollDown filled the blank line it inserts at the top of the scroll region with DEFAULT_ATTR_DATA, while scrollUp, insertLines, deleteLines and the erase operations all use the current erase attributes. As a result, scrolling down after setting a background color (back-color erase) produced a line with the default background instead of the active one. Use _eraseAttrData() to match the sibling operations.
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.
scrollDown(SD,CSI Ps T) does not honor back-color-erase: the blank line it inserts at the top of the scroll region is filled withDEFAULT_ATTR_DATAinstead of the current SGR background.Every other place that introduces blank cells (ED, EL, ECH, alt-buffer clear,
insertLines,deleteLines, and notably its siblingscrollUp) usesthis._eraseAttrData(), which folds the active background into the erase attributes. OnlyscrollDownuses the default, so after an application sets a background (for exampleCSI 41m) and scrolls the region down, the new line shows the terminal default background instead of the active one, leaving a wrong cell-attribute state that is visible in TUIs and shells.Fix
Use
this._eraseAttrData()for the inserted line, matchingscrollUp(InputHandler.ts) and the other blank-cell paths.DEFAULT_ATTR_DATAis still used elsewhere, so there is no orphaned import.Testing
Added a test to the
scroll marginsblock ofInputHandler.test.ts: set a red background, define a scroll region, scroll down, and assert the inserted blank line carries that background. It fails on the current code (background color comes back as the default) and passes with the fix. The fullInputHandlersuite stays green (193 passing).