-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Erase Color Mode (DECECM) #15469
Conversation
Some screenshots for comparison with the VT525 output in #14983 (comment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seriously reviewed the whole thing and not a single comment haha. Thanks for doing this!
BTW I was reading what |
Yeah, that sounds like a good idea. |
I've kicked the test job in CI :) |
The Erase Color Mode determines what attributes are written to the
buffer when erasing content, or when new content is scrolled onto the
screen. When the mode is reset (which is the default), we erase with the
active colors, but with rendition attributes cleared. When the mode is
set, we erase with the default attributes, i.e. with neither color nor
rendition attributes applied.
This could be used to address the problem described in issue #10556.
Most of the affected operations are handled within the
AdaptDispatch
class, so I've simply updated them all to use a new helper method which
returns the appropriate erase attributes for the active mode.
However, there were a couple of operations that are handled elsewhere,
and which now require the erase attributes to be passed to them as a
parameter.
The
TextBuffer::IncrementCircularBuffer
method, which is used torecycle the topmost row when scrolling past the bottom of the buffer.
The
TextBuffer::SetCurrentLineRendition
method, which has to clearthe second half of the line when switching to a double width rendition.
The
ITerminalApi::UseAlternateScreenBuffer
method, which has toclear the screen when switching to the alternate buffer.
Then there is also a Clear Buffer action in Windows Terminal, which is
ultimately handled by the
SCREEN_INFORMATION::ClearBuffer
method inConHost. That class has no access to the erase color mode, so has no way
of knowing which attributes to use. So I've now rewritten it to use the
AdaptDispatch::EraseInDisplay
method to handle the erasing.Validation Steps Performed
I wrote a little test script that exercises the operations affected by
DECECM
, which @al20878 kindly tested for us on a real DEC VT525, andprovided screenshots of the output. I've manually confirmed that our
implementation exactly matches those results.
I've also added a unit test that runs through the same set of operations
and verified that each of them is using the appropriate attributes when
DECECM
is enabled and enabled.Closes #14983