-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 the "concealed" graphic rendition attribute #6907
Conversation
…and resetting the concealed attribute.
…ct on the color calculations.
Hello @DHowett! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 7 hours 15 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
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.
🎉 Handy links: |
Summary of the Pull Request
This PR adds support for the
SGR 8
andSGR 28
escape sequences,which enable and disable the concealed/invisible graphic rendition
attribute. When a character is output with this attribute set, it is
rendered with the same foreground and background colors, so the text is
essentially invisible.
PR Checklist
where discussion took place: Add support for the "concealed" graphic rendition attribute #6876
Detailed Description of the Pull Request / Additional comments
Most of the framework for this attribute was already implemented, so it
was just a matter of updating the
TextAttribute::CalculateRgbColors
method to make the foreground the same as the background when the
Invisible flag was set. Note that this has to happen after the
Reverse Video attribute is applied, so if you have white-on-black text
that is reversed and invisible, it should be all white, rather than all
black.
Validation Steps Performed
There were already existing SGR unit tests covering this attribute in
the
ScreenBufferTests
, and theVtRendererTest
. But I've added to theAdapterTest
which verifies the SGR sequences for setting and resettingthe attribute, and I've extended the
TextAttributeTests
to verify thatthe color calculations return the correct values when the attribute is
set.
I've also manually confirmed that we now render the concealed text
values correctly in the ISO 6429 tests in Vttest. And I've manually
tested the output of concealed when combined with other attributes,
and made sure that we're matching the behaviour of most other terminals.