Clear scroll marks when clearing the buffer#20105
Clear scroll marks when clearing the buffer#20105SushaanthSrinivasan wants to merge 2 commits intomicrosoft:mainfrom
Conversation
DHowett
left a comment
There was a problem hiding this comment.
I am surprised that the Erase in Screen handler does not already do this.
It seems to me that fixing the issue in this layer will not fix the case in issue #20086 with the clear command, because the clear command does not run through this code.
We should fix this in the appropriate layer if possible.
There was a problem hiding this comment.
added ClearMarksInRange to _EraseAll() in adaptDispatch.cpp — fixes clear/cls which go through the \x1b[2J path.
ctrl+shift+k still needs the ControlCore fix though — ClearBuffer() uses DL + ED0 to preserve the cursor row (GH#18732), so it never hits _EraseAll.
pushed both fixes, tested all three paths (ctrl+shift+k, bash clear, powershell cls). dropping the screen rec below:
Summary
Fixes #20086 — Ctrl+Shift+K (Clear Buffer) now clears scroll marks from the scrollbar.
References and Relevant Issues
Detailed Description
ControlCore::ClearBuffer()sends VT escape sequences to clear the buffer. The scrollback path (\x1b[3J) already clears marks viaTextBuffer::ClearScrollback, but the screen-clearing path doesn't touch marks — they persist stale in the scrollbar.This adds a
ClearAllMarks()call inside the existing lock block after the VT sequences are written, for bothScreenandAllclear types.Validation Steps
"showMarksOnScrollbar": truein profile defaultsbefore.after.mp4