Skip to content
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

SGR 8 doesn't work when acrylic is enabled #11919

Closed
j4james opened this issue Dec 9, 2021 · 5 comments
Closed

SGR 8 doesn't work when acrylic is enabled #11919

j4james opened this issue Dec 9, 2021 · 5 comments
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@j4james
Copy link
Collaborator

j4james commented Dec 9, 2021

Windows Terminal version

1.12.2931.0

Windows build number

10.0.19041.1348

Other Software

No response

Steps to reproduce

  1. In the Setting UI, go to the Profiles Defaults page and select the Appearance tab.
  2. Make sure the option Automaticaly adjust lightness of indistinguishable text is disabled (see SGR 1 and SGR 8 don't work when adjusting lightness of indistinguishable text #11917).
  3. Make sure the Enable acrylic option is on.
  4. Set the Background opacity slider to 50%.
  5. Open a bash shell.
  6. Execute the following command: printf "\e[8m CONCEALED \e[m\n"
  7. Move the terminal window over something that is white/bright in color.

Expected Behavior

I'd expect the text to be completely invisible.

Actual Behavior

The text is quite clearly visible.

image

An easy fix for this might be to include an additional attr.IsInvisible() test in the condition here:

// We only care about alpha for the default BG (which enables acrylic)
// If the bg isn't the default bg color, or reverse video is enabled, make it fully opaque.
if (!attr.BackgroundIsDefault() || (attr.IsReverseVideo() ^ _screenReversed))
{
colors.second |= 0xff000000;
}

The concealed text wouldn't show as transparent, but would instead appear as an opaque version of the background color, as if it had been blacked out by a censor. That seems like a reasonable rendition I think.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 9, 2021
@zadjii-msft
Copy link
Member

  1. lol
  2. that seems like a reasonable fix to me

@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Dec 9, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 9, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Dec 9, 2021
@DHowett
Copy link
Member

DHowett commented Dec 9, 2021

  1. LOL!
  2. I think the renderer (graphical renderer; the VT one can't do this...) should skip Concealed text entirely. After all... why try our hardest to put down matching pixels when we could just put down nothing at all?

@DHowett
Copy link
Member

DHowett commented Dec 9, 2021

(I say this in part because renderer support for transparent foregrounds is going to be spotty; we have never formally tested it! Atlas engine made an assumption about it as well.)

@j4james
Copy link
Collaborator Author

j4james commented Dec 9, 2021

I think the renderer (graphical renderer; the VT one can't do this...) should skip Concealed text entirely.

I'm not opposed to that, but it does seem likely to be a lot more work for an attribute that's probably not used very often. If someone else is keen to take that on, though, I wouldn't object.

@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jan 3, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
@j4james
Copy link
Collaborator Author

j4james commented Nov 9, 2023

This was actually fixed in PR #12127. As proposed above, we now render the concealed text with an opaque version of the background color. For anyone that would prefer it to be completely transparent, that's tracked in issue #16271.

@j4james j4james closed this as completed Nov 9, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants