Acrylic background doesn't work if foreground is invisible #20776

Open
opened 2026-01-31 07:23:43 +00:00 by claunia · 7 comments
Owner

Originally created by @alabuzhev on GitHub (Nov 6, 2023).

Windows Terminal version

Latest nightly

Windows build number

10.0.19045.3448

Other Software

No response

Steps to reproduce

  1. Enable background transparency and acrylic material in settings.
  2. Run the script below:
@echo off

echo  bold
echo  faint
echo  italic
echo  underline
echo  strikeout
echo  overline
echo  blink
echo  inverse
echo  invisible

pause

- where  is \x1b

Expected Behavior

image

Actual Behavior

image

- "Invisible" foreground causes the background to be fully opaque.

Looking at the code, it seems to be here:
9e86c9811f/src/renderer/base/RenderSettings.cpp (L205-L207)

The || attr.IsInvisible() bit was added here:
https://github.com/microsoft/terminal/pull/12127/files#diff-0f336e9fd3608b43380ed0ad16fc625c4f1e2a681c70fc627f9df7239e1b6d54R252-R253

Looks like it wasn't in the original code:
https://github.com/microsoft/terminal/pull/12127/files#diff-f9112caf8cb75e7a48a7b84987724d754181227385fbfcc2cc09a879b1f97c12L90-L91

The change wasn't reflected in the comment / mentioned elsewhere in the PR (or at least I can't find it), so, is it intentional / a bug?

Originally created by @alabuzhev on GitHub (Nov 6, 2023). ### Windows Terminal version Latest nightly ### Windows build number 10.0.19045.3448 ### Other Software _No response_ ### Steps to reproduce 1. Enable background transparency and acrylic material in settings. 2. Run the script below: ``` @echo off echo  bold echo  faint echo  italic echo  underline echo  strikeout echo  overline echo  blink echo  inverse echo  invisible pause ``` \- where  is \x1b ### Expected Behavior ![image](https://github.com/microsoft/terminal/assets/11453922/95df0270-308d-45b2-8e1e-105b0a8b7a65) ### Actual Behavior ![image](https://github.com/microsoft/terminal/assets/11453922/65a97640-eb16-45ec-ba4e-9d52ca30c065) \- "Invisible" foreground causes the background to be fully opaque. Looking at the code, it seems to be here: https://github.com/microsoft/terminal/blob/9e86c9811f2cf0ad53c9c543b886274b1079dd00/src/renderer/base/RenderSettings.cpp#L205-L207 The ` || attr.IsInvisible()` bit was added here: https://github.com/microsoft/terminal/pull/12127/files#diff-0f336e9fd3608b43380ed0ad16fc625c4f1e2a681c70fc627f9df7239e1b6d54R252-R253 Looks like it wasn't in the original code: https://github.com/microsoft/terminal/pull/12127/files#diff-f9112caf8cb75e7a48a7b84987724d754181227385fbfcc2cc09a879b1f97c12L90-L91 The change wasn't reflected in the comment / mentioned elsewhere in the PR (or at least I can't find it), so, is it intentional / a bug?
claunia added the Area-RenderingIssue-BugPriority-3Product-Terminal labels 2026-01-31 07:23:44 +00:00
Author
Owner

@j4james commented on GitHub (Nov 7, 2023):

It was an intentional fix for issue #11919, but I must have forgotten to reference it in the PR notes, and obviously that issue should also have been closed now.

The fact that it renders opaque with an acrylic background was a known compromise which I mentioned in #11919. Personally I kind of like the effect, but I also wouldn't care if someone wanted to make it fully transparent. That would likely be more complicated though.

@j4james commented on GitHub (Nov 7, 2023): It was an intentional fix for issue #11919, but I must have forgotten to reference it in the PR notes, and obviously that issue should also have been closed now. The fact that it renders opaque with an acrylic background was a known compromise which I mentioned in #11919. Personally I kind of like the effect, but I also wouldn't care if someone wanted to make it fully transparent. That would likely be more complicated though.
Author
Owner

@j4james commented on GitHub (Nov 7, 2023):

See also #7014.

@j4james commented on GitHub (Nov 7, 2023): See also #7014.
Author
Owner

@DHowett commented on GitHub (Nov 7, 2023):

I also wouldn't care if someone wanted to make it fully transparent.

I keep thinking about this - we could probably skip it in the renderer completely. The VtEngine would of course continue to produce it, but the actual graphical engines could ignore it and it would definitely appear to be concealed 😆

@DHowett commented on GitHub (Nov 7, 2023): > I also wouldn't care if someone wanted to make it fully transparent. I keep thinking about this - we could probably skip it in the renderer completely. The VtEngine would of course continue to produce it, but the actual graphical engines could ignore it and it would definitely _appear_ to be concealed :laugh:
Author
Owner

@alabuzhev commented on GitHub (Nov 7, 2023):

Thanks James.
Personally I don't really care how exactly it works, just reporting an inconsistency with other terminals:

image

Fully transparent could be beneficial at least for the sake of consistency and reducing the amount of WTFs/min (I thought there's a bug in my code somewhere).

@alabuzhev commented on GitHub (Nov 7, 2023): Thanks James. Personally I don't really care how exactly it works, just reporting an inconsistency with other terminals: ![image](https://github.com/microsoft/terminal/assets/11453922/9ea22b6b-8887-409c-b246-e8fed9fd2d56) Fully transparent could be beneficial at least for the sake of consistency and reducing the amount of WTFs/min (I thought there's a bug in my code somewhere).
Author
Owner

@zadjii-msft commented on GitHub (Dec 11, 2023):

Pretty sure this is just a dup of #7014? Or, a more specific subset of that?

@zadjii-msft commented on GitHub (Dec 11, 2023): Pretty sure this is just a dup of #7014? Or, a more specific subset of that?
Author
Owner

@alabuzhev commented on GitHub (Dec 11, 2023):

@zadjii-msft not really. Both are about transparency handling, but #7014 is about the text (when "reversed"), while this one is about the background (when "concealed").

@alabuzhev commented on GitHub (Dec 11, 2023): @zadjii-msft not really. Both are about transparency handling, but #7014 is about the text (when "reversed"), while this one is about the background (when "concealed").
Author
Owner

@j4james commented on GitHub (Dec 11, 2023):

They are kind of related, in that the concealed background only lost its transparency in order to fix #11919, but if we had support for transparent text (via #7014), then #11919 could probably have been fixed by rendering both the foreground and background as transparent.

That said, I'm inclined to agree with @DHowett that skipping the rendering of concealed text entirely might be the best approach to take.

@j4james commented on GitHub (Dec 11, 2023): They are kind of related, in that the concealed background only lost its transparency in order to fix #11919, but if we had support for transparent text (via #7014), then #11919 could probably have been fixed by rendering both the foreground and background as transparent. That said, I'm inclined to agree with @DHowett that skipping the rendering of concealed text entirely might be the best approach to take.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20776