microsoft / microsoft/terminal

Acrylic background doesn't work if foreground is invisible

Open
#16,271 7 comments 0 reactions 0 assignees View on GitHub
Area-Rendering Issue-Bug Priority-3 Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### 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?

Contributor guide

Open the contributing guide

Research direction

Start in src/renderer/base/RenderSettings.cpp around lines 205-207 and compare the linked history for the IsInvisible() change. Reproduce the batch script with acrylic transparency enabled, then verify that invisible foreground text no longer makes the background fully opaque and that the behavior matches the expected image.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.