Inconsistent terminal color (on startup) #21467

Open
opened 2026-01-31 07:45:36 +00:00 by claunia · 15 comments
Owner

Originally created by @lindhe on GitHub (Apr 2, 2024).

Windows Terminal version

1.19.10573.0

Windows build number

10.0.22631.0

Other Software

> wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3296
  • Ubuntu 22.04.4 LTS
  • ZSH 5.8.1
  • Oh My Zsh version: master (0fed366)
  • ZSH_THEME="bira"

Steps to reproduce

I cannot reproduce it 100% reliably, but I do get it fairly regularly (at least once per day).

It typically happens for the first terminal I create after I boot my computer.

Expected Behavior

If I open multiple panes/tabs/windows, they should all have the same colorscheme (or render the colors the same way).

Actual Behavior

For the first terminal I create, I get colors that are slightly off. All panes/tabs/windows I create after that have correct colors:

Screenshot 2024-04-02 162159

In this example, the upper pane is the first pane and the lower pane was created later.

According to the color picker from PowerToys, these are the colors I get in the screenshot example:

Black White Green Blue
Upper pane #0c0c0c #f0f0f0 #4be14b #4040bd
Lower pane #0c0c0c #f0f0f0 #15b40c #3b78ff

Node that there is some variation caused by aliasing, so I may have accidentally picked the wrong colors. But it's an honest attempt. 😅

Originally created by @lindhe on GitHub (Apr 2, 2024). ### Windows Terminal version 1.19.10573.0 ### Windows build number 10.0.22631.0 ### Other Software ```console > wsl --version WSL version: 2.1.5.0 Kernel version: 5.15.146.1-2 WSLg version: 1.0.60 MSRDC version: 1.2.5105 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.22631.3296 ``` * Ubuntu 22.04.4 LTS * ZSH 5.8.1 * [Oh My Zsh](https://ohmyz.sh/) version: `master (0fed366)` * `ZSH_THEME="bira"` ### Steps to reproduce I cannot reproduce it 100% reliably, but I do get it fairly regularly (at least once per day). It typically happens for the first terminal I create after I boot my computer. ### Expected Behavior If I open multiple panes/tabs/windows, they should all have the same colorscheme (or render the colors the same way). ### Actual Behavior For the first terminal I create, I get colors that are slightly off. All panes/tabs/windows I create after that have correct colors: ![Screenshot 2024-04-02 162159](https://github.com/microsoft/terminal/assets/7773090/46047725-90b0-48dc-836d-3ae76e0fee00) In this example, the upper pane is the first pane and the lower pane was created later. According to the color picker from PowerToys, these are the colors I get in the screenshot example: | | Black | White | Green | Blue | | ------------- | ----- | ------- | ------- | ---- | | Upper pane | `#0c0c0c`| `#f0f0f0` | `#4be14b` | `#4040bd` | | Lower pane | `#0c0c0c` | `#f0f0f0` | `#15b40c` | `#3b78ff` | Node that there is some variation caused by aliasing, so I may have accidentally picked the wrong colors. But it's an honest attempt. 😅
claunia added the Area-RenderingIssue-BugProduct-Terminal labels 2026-01-31 07:45:36 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 2, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Apr 2, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Terminal background color will frequently and partially switch colors after exiting Vim (#5786)](https://github.com/microsoft/terminal/issues/5786), similarity score: 0.76 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@zadjii-msft commented on GitHub (Apr 2, 2024):

Could you share your settings.json file/?

@zadjii-msft commented on GitHub (Apr 2, 2024): Could you share your [settings.json file](https://github.com/microsoft/terminal/wiki/Frequently-Asked-Questions-(FAQ)#where-can-i-find-the-settings-file)/?
Author
Owner

@lindhe commented on GitHub (Apr 2, 2024):

Of course! Here: settings.json

@lindhe commented on GitHub (Apr 2, 2024): Of course! Here: [settings.json](https://github.com/microsoft/terminal/files/14840295/settings.json)
Author
Owner

@carlos-zamora commented on GitHub (Apr 3, 2024):

Thanks for filing! We took a look at the settings.json file and nothing stood out. Could you capture a Debug Tap of when the terminal launches with this unexpected configuration/? Be sure to hold both alt buttons when the terminal launches to get it to work.

@carlos-zamora commented on GitHub (Apr 3, 2024): Thanks for filing! We took a look at the settings.json file and nothing stood out. Could you [capture a Debug Tap](https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap) of when the terminal launches with this unexpected configuration/? Be sure to hold both alt buttons when the terminal launches to get it to work.
Author
Owner

@lindhe commented on GitHub (Apr 5, 2024):

I've activated the debug trap now, but I was not able to immediately reproduce the issue. It comes every now and then for me, I'll post here as soon as I catch one!

@lindhe commented on GitHub (Apr 5, 2024): I've activated the debug trap now, but I was not able to immediately reproduce the issue. It comes every now and then for me, I'll post here as soon as I catch one!
Author
Owner

@lindhe commented on GitHub (Apr 15, 2024):

I have so far been unable to reproduce the bug with the debug tap active. I will keep trying for a while longer, but maybe the bug does not show up with the tap active?

@lindhe commented on GitHub (Apr 15, 2024): I have so far been unable to reproduce the bug with the debug tap active. I will keep trying for a while longer, but maybe the bug does not show up with the tap active?
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2024):

But it does show up relatively consistently without the debug tap? That would be.... extremely bizarre. Especially since the color values in the image don't actually look like they're coming from the color schemes, so that would seemingly suggest that there's something in your prompt that's manually emitting those colors?

@zadjii-msft commented on GitHub (Apr 15, 2024): But it does show up relatively consistently without the debug tap? That would be.... extremely bizarre. Especially since the color values in the image don't actually look like they're coming from the color schemes, so that would seemingly suggest that there's something in your prompt that's manually emitting those colors?
Author
Owner

@lindhe commented on GitHub (Apr 15, 2024):

Yes, it happens multiple times per day, but I have not yet figured out a way to reliably reproduce it. Mostly I think it's when I leave the computer on for a while and the screen goes dark after screen lock (e.g. during lunch). When I come back, it's very frequent that this problem occurs.

Next time I catch it, I'll try to echo a color (e.g. echo -e '\e[34m\e[1m\u25A0\e[0m') and inspect what color that is. That might give us a clue if this is the text output that goes wrong or if all colors are off. ¯\_(ツ)_/¯

I'll do my best to try and figure out the exact circumstances. Will keep you posted!

@lindhe commented on GitHub (Apr 15, 2024): Yes, it happens multiple times per day, but I have not yet figured out a way to reliably reproduce it. Mostly I think it's when I leave the computer on for a while and the screen goes dark after screen lock (e.g. during lunch). When I come back, it's very frequent that this problem occurs. Next time I catch it, I'll try to echo a color (e.g. `echo -e '\e[34m\e[1m\u25A0\e[0m'`) and inspect what color that is. That might give us a clue if this is the text output that goes wrong or if all colors are off. ¯\\\_(ツ)_\/¯ I'll do my best to try and figure out the exact circumstances. Will keep you posted!
Author
Owner

@lindhe commented on GitHub (Apr 22, 2024):

Just FYI: I'll get back whenever I have new info. If this is automatically closed, I'll just reopen it. 👍

@lindhe commented on GitHub (Apr 22, 2024): Just FYI: I'll get back whenever I have new info. If this is automatically closed, I'll just reopen it. 👍
Author
Owner

@DHowett commented on GitHub (Apr 22, 2024):

Thanks! If you don't have the rights to reopen it, let one of us know and we will!

@DHowett commented on GitHub (Apr 22, 2024): Thanks! If you don't have the rights to reopen it, let one of us know and we will!
Author
Owner

@lindhe commented on GitHub (May 3, 2024):

I just had it occur again and was able to capture the output of echo '\e[34m\e[1m\u25A0\e[0m':

image

Upper pane: #5454ff
Lower pane: #3b78ff

@lindhe commented on GitHub (May 3, 2024): I just had it occur again and was able to capture the output of `echo '\e[34m\e[1m\u25A0\e[0m'`: ![image](https://github.com/microsoft/terminal/assets/7773090/c8397859-2038-43a0-9824-8f0c98c167aa) Upper pane: `#5454ff` Lower pane: `#3b78ff`
Author
Owner

@lhecker commented on GitHub (May 3, 2024):

The image you shared has a background color of #050505 but the settings.json you previously shared doesn't have such a color anywhere. The first screenshot you shared in the beginning has #0c0c0c which does exist in one of the themes. Couple related questions:

  • Did you change your settings.json since then?
  • Are you using an HDR display?
  • If you open the Settings app and go to System > Display > Color Management, do you have a display profile set up?
  • ...and if you have a "Automatically manage color for apps" toggle there, is it turned on or off?

I think this may be a memory corruption of our color table(s).

@lhecker commented on GitHub (May 3, 2024): The image you shared has a background color of `#050505` but the `settings.json` you previously shared doesn't have such a color anywhere. The first screenshot you shared in the beginning has `#0c0c0c` which does exist in one of the themes. Couple related questions: * Did you change your `settings.json` since then? * Are you using an HDR display? * If you open the Settings app and go to System > Display > Color Management, do you have a display profile set up? * ...and if you have a "Automatically manage color for apps" toggle there, is it turned on or off? I think this may be a memory corruption of our color table(s).
Author
Owner

@lindhe commented on GitHub (May 3, 2024):

  • Did you change your settings.json since then?

No.

  • Are you using an HDR display?

On the monitor I took the screenshot on (my external monitor): no. On my laptop: yes. And would that really matter when taking a screenshot or measuring with the color picker tool from PowerToys?

  • If you open the Settings app and go to System > Display > Color Management, do you have a display profile set up?

I didn't find "Color management". Is it the same as "Colour profile"? I've got a profile for my external monitor but not the built in one:
image

  • ...and if you have a "Automatically manage color for apps" toggle there, is it turned on or off?

It's off for both displays.

I think this may be a memory corruption of our color table(s).

I always find the bizarre ones: 😂

@lindhe commented on GitHub (May 3, 2024): > * Did you change your `settings.json` since then? No. > * Are you using an HDR display? On the monitor I took the screenshot on (my external monitor): no. On my laptop: yes. And would that really matter when taking a screenshot or measuring with the color picker tool from PowerToys? > * If you open the Settings app and go to System > Display > Color Management, do you have a display profile set up? I didn't find "Color management". Is it the same as "Colour profile"? I've got a profile for my external monitor but not the built in one: ![image](https://github.com/microsoft/terminal/assets/7773090/f25ef7fe-bd4a-49e4-b1b7-62f64ba0355d) > * ...and if you have a "Automatically manage color for apps" toggle there, is it turned on or off? It's off for both displays. > I think this may be a memory corruption of our color table(s). I always find the bizarre ones: 😂
Author
Owner

@lhecker commented on GitHub (May 3, 2024):

And would that really matter when taking a screenshot or measuring with the color picker tool from PowerToys?

Yes, at least in my understanding. DWM composites all applications into a single surface which has a color format and space that fits the target display. Windows Terminal renders text into a BGR (reverse RGB) 8-bit surface, which DWM composites into for instance (I'm not actually sure which one specifically) RGB with 16-bit floats to later output it on a HDR display. When you take a screenshot, it'll take a copy from that DWM surface and then convert it back to 8-bit RGB.

I've got a profile for my external monitor but not the built in one:

GPUs should apply color profiles very late with a matrix or LUT transform, only when actually sending the image to the monitor. I was just wondering if it's possible that a color profile may get applied early by DWM and if so, if it may not be applied to all swap chains (= all panes/tabs). I don't think that's possible, but...

Well maybe it's indeed a memory corruption. But it'd definitely be the first and only report about it so far!

@lhecker commented on GitHub (May 3, 2024): > And would that really matter when taking a screenshot or measuring with the color picker tool from PowerToys? Yes, at least in my understanding. DWM composites all applications into a single surface which has a color format and space that fits the target display. Windows Terminal renders text into a BGR (reverse RGB) 8-bit surface, which DWM composites into for instance (I'm not actually sure which one specifically) RGB with 16-bit floats to later output it on a HDR display. When you take a screenshot, it'll take a copy from that DWM surface and then convert it back to 8-bit RGB. > I've got a profile for my external monitor but not the built in one: GPUs should apply color profiles very late with a matrix or LUT transform, only when actually sending the image to the monitor. I was just wondering if it's possible that a color profile may get applied early by DWM and if so, if it may not be applied to all swap chains (= all panes/tabs). I don't think that's possible, but... Well maybe it's indeed a memory corruption. But it'd definitely be the first and only report about it so far!
Author
Owner

@lindhe commented on GitHub (May 8, 2025):

So it seems that Windows Terminal has even worse color rendering issues. I tried different color schemes on k9s recently, because I thought the default theme was hard to read. Turns out Windows Terminal refuses to render colors correctly, making it impossible to read colored text on colored backgrounds. And it's different in different panes for me.

If I set body.bgColor: black then the color is #000000 (inspected with eyedropper tool). If I set views.table.cursorFgColor: black, the text is #808080.

If I set body.bgColor: red then the color is #ff3e30. If I set views.table.cursorFgColor: red, the text is #ff3e30.

If I set body.bgColor: '#123123' then the color is #303030. If I set views.table.cursorFgColor: '#123123', the text is #303030.

Then I open a new pane in the same window, with color configured to be '#ffffff'. This leaves me with #ffffff in one pane and #f2f2f2 in another.

Sorry guys, I give up. I need a terminal that works. Guess I'll have to look elsewhere. 😕

@lindhe commented on GitHub (May 8, 2025): So it seems that Windows Terminal has even worse color rendering issues. I tried different color schemes on k9s recently, because I thought the default theme was hard to read. Turns out Windows Terminal refuses to render colors correctly, making it impossible to read colored text on colored backgrounds. And it's different in different panes for me. If I set body.bgColor: black then the color is #000000 (inspected with eyedropper tool). If I set views.table.cursorFgColor: black, the text is #808080. If I set body.bgColor: red then the color is #ff3e30. If I set views.table.cursorFgColor: red, the text is #ff3e30. If I set body.bgColor: '#123123' then the color is #303030. If I set views.table.cursorFgColor: '#123123', the text is #303030. Then I open a new pane in the same window, with color configured to be `'#ffffff'`. This leaves me with `#ffffff` in one pane and `#f2f2f2` in another. Sorry guys, I give up. I need a terminal that works. Guess I'll have to look elsewhere. 😕
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21467