Skip to content

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

Closed

Description

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.

Activity

  1. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Jul 11, 2020
  2. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jul 11, 2020
  3. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Jul 11, 2020
  4. DHowett commented on Jul 11, 2020

    @DHowett
    Member

    Philosophically, if it's not copyable and not rendered in xterm, is there any meaningful difference between it being concealed and it simply not existing?

    For us, matching the colors and leaving it copyable sounds great. I'm r+ on this proposal!

  5. added
    Area-VTVirtual Terminal sequence support
    Issue-TaskIt's a feature request, but it doesn't really need a major design.
    Product-ConhostFor issues in the Console codebase
    and removed
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    on Jul 11, 2020
  6. ghost removed
    Needs-Tag-FixDoesn't match tag requirements
    on Jul 11, 2020
  7. removed
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Jul 11, 2020
  8. j4james commented on Jul 11, 2020

    @j4james
    CollaboratorAuthor

    Philosophically, if it's not copyable and not rendered in xterm, is there any meaningful difference between it being concealed and it simply not existing?

    That depends on the implementation. If they're still writing the text to the buffer, then it could potentially be revealed through other means, e.g. by changing the attributes with DECARA, or reading the content back via DECRQCRA. I couldn't get DECARA to work, but I'm not sure if that's just a bug. And I didn't try DECRQCRA, but I suspect it wouldn't work either - my guess is they're not actually storing anything.

    Anyway I don't think it matters much. This is one of those things that doesn't have a clear right answer, because the ANSI/ECMA specs don't go into any detail, and the DEC terminals never had this functionality. I figure as long as we're doing what most others are doing then we're probably OK.

  9. jdebp commented on Jul 13, 2020

    @jdebp

    DECCARA is documented as only affecting specific attributes, of which this is not one. But the DEC doco does state that invisibility is rendered by making the foreground colour the same as the background colour.

    Observe, furthermore, that kitty extends DECCARA to cover this attribute.

  10. j4james commented on Jul 13, 2020

    @j4james
    CollaboratorAuthor

    But the DEC doco does state that invisibility is rendered by making the foreground colour the same as the background colour.

    That's good to know - thanks for pointing that out. I was under the impression that none of the DEC terminals supported the concealed/invisible attribute, possibly because it's not listed in the functions summary table of the VT520 Programmer Reference. But I see now that even the VT420 supported it.

    DECCARA is documented as only affecting specific attributes, of which this is not one.

    Yeah I saw that, but I thought (incorrectly) that that was just because they didn't support the concealed attribute in general. I suppose it's still possible that was an oversight in the docs.

    Observe, furthermore, that kitty extends DECCARA to cover this attribute.

    I thought XTerm did that too (see here), but as I mentioned above I couldn't get it to work. I don't think I tested DECCARA on kitty. Not that it matters much at the moment. We can figure out those details when we actually implement those ops.

  11. ghost added
    In-PRThis issue has a related PR
    on Jul 13, 2020
  12. ghost closed this as completedin #6907on Jul 14, 2020
  13. ghost removed
    In-PRThis issue has a related PR
    on Jul 14, 2020
  14. ghost added a commit that references this issue on Jul 14, 2020
    b2973eb
  15. ghost added
    Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.
    on Jul 14, 2020
  16. DHowett commented on Aug 21, 2020

    @DHowett
    Member

    🎉 As of Windows Insider build 20197, this is also supported in the traditional console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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