Skip to content

Add support for the "concealed" graphic rendition attribute #6876

@j4james

Description

@j4james

Description of the new feature/enhancement

The ANSI SGR 8 rendition attribute is used to indicate that text to which it's applied should be rendered invisible. I'm not sure how widely it's used, but it is supported by most terminal emulators, so I think it's probably worth doing. And most of the framework is already in place, so it's an easy addition for us.

Proposed technical implementation details (optional)

I think all that's required is an update to the TextAttribute::CalculateRgbColors method, adjusting the colors to make the foreground and background the same when the attribute is set. Something like:

if (IsInvisible())
{
    fg = bg;
}

In testing this on other terminals, I found that XTerm also prevented the invisible content being copied to the clipboard. However, pretty much everyone else allowed it to be copied, so I'm more inclined to follow the majority behaviour.

I have a PR ready to submit for this if you're happy with the idea and the proposed approach, but it'd be best if #6873 is merged first, otherwise there'll probably be conflicts in the unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportIssue-TaskIt's a feature request, but it doesn't really need a major design.Priority-2A description (P2)Product-ConhostFor issues in the Console codebaseProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions