[PR #6907] Add support for the "concealed" graphic rendition attribute #26806

Open
opened 2026-01-31 09:18:16 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/6907

State: closed
Merged: Yes


Summary of the Pull Request

This PR adds support for the SGR 8 and SGR 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

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 the VtRendererTest. But I've added to the
AdapterTest which verifies the SGR sequences for setting and resetting
the attribute, and I've extended the TextAttributeTests to verify that
the 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.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/6907 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This PR adds support for the `SGR 8` and `SGR 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 * [x] Closes #6876 * [x] CLA signed. * [x] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [x] I've discussed this with core contributors already. Issue number where discussion took place: #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 the `VtRendererTest`. But I've added to the `AdapterTest` which verifies the SGR sequences for setting and resetting the attribute, and I've extended the `TextAttributeTests` to verify that the 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.
claunia added the pull-request label 2026-01-31 09:18:16 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26806