Terminal background color has the wrong color applied when terminal is snapped #7213

Closed
opened 2026-01-31 00:58:01 +00:00 by claunia · 7 comments
Owner

Originally created by @soul4soul on GitHub (Mar 30, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.720]
Windows Terminal version (if applicable): 0.10.781.0

Any other software? A preview version of PS7 which displays a "new release is available banner"

Steps to reproduce

  1. Configure PS 7 preview shell as the default profile
  2. Launch WT
  3. Snap terminal left immediately after launch as soon as WT is visible. I suspect it needs to get snapped while the banner is being drawn before the shell is ready for input.
  4. See background color from the PS 7 new release banner is used for the entire terminals background color
  5. As new text is drawn to the window the background color starts to go away and correct itself.

I saw this behavior by off change. After it happened once I was able to repo after a dozen or so launches.

Expected behavior

  1. The background color used by the new release banner should not be drawn over the entire terminal window.

Actual behavior

  1. Banner background is used as the terminal background color

First time it happened:
image

Second time it happened:
image

Originally created by @soul4soul on GitHub (Mar 30, 2020). # Environment ```none Windows build number: Microsoft Windows [Version 10.0.18363.720] Windows Terminal version (if applicable): 0.10.781.0 Any other software? A preview version of PS7 which displays a "new release is available banner" ``` # Steps to reproduce 1. Configure PS 7 preview shell as the default profile 1. Launch WT 1. Snap terminal left immediately after launch as soon as WT is visible. I suspect it needs to get snapped while the banner is being drawn before the shell is ready for input. 1. See background color from the PS 7 new release banner is used for the entire terminals background color 1. As new text is drawn to the window the background color starts to go away and correct itself. I saw this behavior by off change. After it happened once I was able to repo after a dozen or so launches. <!-- A description of how to trigger this bug. --> # Expected behavior 1. The background color used by the new release banner should not be drawn over the entire terminal window. <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior 1. Banner background is used as the terminal background color <!-- What's actually happening? --> First time it happened: ![image](https://user-images.githubusercontent.com/5142635/77914902-9f1d1200-7264-11ea-99a6-51be4b3c35cf.png) Second time it happened: ![image](https://user-images.githubusercontent.com/5142635/77914925-a6442000-7264-11ea-9bb8-a7523d9a0931.png)
Author
Owner

@zadjii-msft commented on GitHub (Mar 30, 2020):

Thanks for the report! This is actually one of the oldest bugs in the console, and already being tracked by another issue on our repo - please refer to #32 for more discussion.

/dup #32

@zadjii-msft commented on GitHub (Mar 30, 2020): Thanks for the report! This is actually _one of the oldest bugs in the console_, and already being tracked by another issue on our repo - please refer to #32 for more discussion. /dup #32
Author
Owner

@ghost commented on GitHub (Mar 30, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Mar 30, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@soul4soul commented on GitHub (Mar 31, 2020):

@zadjii-msft
This issue seems slightly different from #32. In all screenshots provided in #32 only the line with the colored region is draw to the end of that line.

I'm seeing other lines be drawn with the colored region. Lines which were emitted before the color region are using the colored region color. Another symptom I see is the BG color continues to use the the color from the banner even after I enter new commands and the window scrolls.

I can still accept it's a dupe. I just want to be clear about the problem I see.

image
image

@soul4soul commented on GitHub (Mar 31, 2020): @zadjii-msft This issue seems slightly different from #32. In all screenshots provided in #32 only the line with the colored region is draw to the end of that line. I'm seeing other lines be drawn with the colored region. Lines which were emitted before the color region are using the colored region color. Another symptom I see is the BG color continues to use the the color from the banner even after I enter new commands and the window scrolls. I can still accept it's a dupe. I just want to be clear about the problem I see. ![image](https://user-images.githubusercontent.com/5142635/78041051-4457e900-733e-11ea-82da-9b02b8d56609.png) ![image](https://user-images.githubusercontent.com/5142635/78040957-24c0c080-733e-11ea-9e1d-d62249195d73.png)
Author
Owner

@zadjii-msft commented on GitHub (Mar 31, 2020):

Ah yea, okay, I see it now. That's what I get for triaging in the morning.

Looks like the problem is that when the buffer is getting resized, we're using the current attributes to initialize all the lines, not the default attributes. If you do the resize while the banner is being drawn, that means the attributes have been set to black-on-white, which is why the white seems to have filled the rest of the buffer.

It's a similar bug to #32, but it's definitely unique. I'll re-triage

@zadjii-msft commented on GitHub (Mar 31, 2020): Ah yea, okay, I see it now. That's what I get for triaging in the morning. Looks like the problem is that when the buffer is getting resized, we're using the _current_ attributes to initialize all the lines, not the _default_ attributes. If you do the resize while the banner is being drawn, that means the attributes have been set to black-on-white, which is why the white seems to have filled the rest of the buffer. It's a similar bug to #32, but it's definitely unique. I'll re-triage
Author
Owner

@j4james commented on GitHub (Mar 31, 2020):

This sounds like the same problem as https://github.com/microsoft/terminal/issues/3848#issuecomment-562906476.

@j4james commented on GitHub (Mar 31, 2020): This sounds like the same problem as https://github.com/microsoft/terminal/issues/3848#issuecomment-562906476.
Author
Owner

@zadjii-msft commented on GitHub (Apr 1, 2020):

Oh dang, you're totally right @j4james. Thanks for finding that!

/dup #3848

@zadjii-msft commented on GitHub (Apr 1, 2020): Oh dang, you're totally right @j4james. Thanks for finding that! /dup #3848
Author
Owner

@ghost commented on GitHub (Apr 1, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Apr 1, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7213