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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5509
Author: @j4james
Created: 4/23/2020
Status: Merged
Merged: 4/23/2020
Merged by: @DHowett-MSFT

Base: masterHead: fix-reversed-acrylic


📝 Commits (1)

  • fb16506 Make sure the background color is opaque if reverse video mode is enabled.

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 src/cascadia/TerminalCore/terminalrenderdata.cpp (+2 -2)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/5509 **Author:** [@j4james](https://github.com/j4james) **Created:** 4/23/2020 **Status:** ✅ Merged **Merged:** 4/23/2020 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `fix-reversed-acrylic` --- ### 📝 Commits (1) - [`fb16506`](https://github.com/microsoft/terminal/commit/fb16506c69d42d58f7a4ec87d9f005775fb60a72) Make sure the background color is opaque if reverse video mode is enabled. ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/terminalrenderdata.cpp` (+2 -2) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:15:30 +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#26348