[PR #5509] Make sure background color is opaque when attrs are reversed #26353

Open
opened 2026-01-31 09:15:31 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/5509

State: closed
Merged: Yes


Summary of the Pull Request

In order to support a transparent background for the acrylic effect, the renderer sets the alpha value to zero for the default background color. However, when the reversed video attribute is set, the background is actually filled with the foreground color, and will not be displayed correctly if it is made transparent. This PR addresses that issue by making sure the rendered background color is opaque if the reversed video attribute is set.

References

  • This is not a major issue at the moment, since the reverse video attribute is not typically forwarded though conpty, but that will change once #2661 is fixed.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This simply adds an additional check in Terminal::GetBackgroundColor to make sure the returned color is opaque if the reverse video attribute is set. At some point in the future this check may need to be extended to support the DECSCNM reverse screen mode, but for now that's not an issue.

Validation Steps Performed

I've run the test case from issue #5498, and confirmed that it now works as expected. I've also got an experimental fix for #2661 that I've tested with this patch, and that now displays reverse video attributes correctly too.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/5509 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request In order to support a transparent background for the acrylic effect, the renderer sets the alpha value to zero for the default background color. However, when the _reversed video_ attribute is set, the background is actually filled with the foreground color, and will not be displayed correctly if it is made transparent. This PR addresses that issue by making sure the rendered background color is opaque if the reversed video attribute is set. ## References * This is not a major issue at the moment, since the _reverse video_ attribute is not typically forwarded though conpty, but that will change once #2661 is fixed. ## PR Checklist * [x] Closes #5498 * [x] CLA signed. * [ ] Tests added/passed * [ ] Requires documentation to be updated * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #5498 ## Detailed Description of the Pull Request / Additional comments This simply adds an additional check in `Terminal::GetBackgroundColor` to make sure the returned color is opaque if the _reverse video_ attribute is set. At some point in the future this check may need to be extended to support the `DECSCNM` reverse screen mode, but for now that's not an issue. ## Validation Steps Performed I've run the test case from issue #5498, and confirmed that it now works as expected. I've also got an experimental fix for #2661 that I've tested with this patch, and that now displays _reverse video_ attributes correctly too.
claunia added the pull-request label 2026-01-31 09:15:31 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26353