You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for the "concealed" graphic rendition attribute #6876
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.
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.
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!
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.
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.
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.
Activity
DHowett commentedon Jul 11, 2020
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!
j4james commentedon Jul 11, 2020
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 viaDECRQCRA. I couldn't getDECARAto work, but I'm not sure if that's just a bug. And I didn't tryDECRQCRA, 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.
jdebp commentedon Jul 13, 2020
DECCARAis 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
DECCARAto cover this attribute.j4james commentedon Jul 13, 2020
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.
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.
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
DECCARAon kitty. Not that it matters much at the moment. We can figure out those details when we actually implement those ops.Add support for the "concealed" graphic rendition attribute (#6907)
DHowett commentedon Aug 21, 2020
🎉 As of Windows Insider build 20197, this is also supported in the traditional console.