Text rendering error with foreground color "White" (aka PowerShell color "Gray" aka ANSI "e[0;37m") #8592

Closed
opened 2026-01-31 01:33:20 +00:00 by claunia · 2 comments
Owner

Originally created by @IarwainBen-adar on GitHub (May 26, 2020).

Environment

Windows build number: 10.0.18363.0
Windows Terminal version (if applicable): 1.0.1401.0
Additional software: PowerShell 7 version 7.0.1; ColorTool 1904.29002

Steps to reproduce

Use ColorTool -c and/or Get-PSReadLineOptions to show current color settings. Observe that the color "Gray" is rendered incorrectly (but seemingly only used as a foreground color — background color "Gray" appears to be fine!) in Windows Terminal.

For the sake of completeness, just in case I am missing something obvious, this is the color scheme I am using:

    {
            "name": "Monokai",
            "foreground": "#F8F8F2",
            "background": "#282923",
            "cursorColor": "#F8F8F2",
            "black": "#282923",
            "red": "#F83535",
            "green": "#537115",
            "yellow": "#FD9621",
            "blue": "#0087AF",
            "purple": "#7356AB",
            "cyan": "#56AB81",
            "white": "#74705D",
            "brightBlack": "#48473D",
            "brightRed": "#F92472",
            "brightGreen": "#A6E22C",
            "brightYellow": "#E7DB74",
            "brightBlue": "#67D8EF",
            "brightPurple": "#AC80FF",
            "brightCyan": "#67D8EF",
            "brightWhite": "#F8F8F2"
    }

Expected behavior

I would expect the color "Gray" to print correctly and consistently for both foreground and background. Powershell 7.0.1 prints "Gray" as I expect.

Actual behavior

See attached screenshots. In each image, two windows are stacked vertically: Windows Terminal above and PowerShell 7 underneath.

ColorTool:
bugreport terminal e 37m
Note the bottom two output rows from colortool -c. Windows Terminal prints the 37m line as color #F8F8F2 (the same color as the 1;37m row), rather than using the scheme-correct color #74705D. Yet Windows Terminal clearly understands that the color #74705D is defined in the scheme as "Gray" — the background of the rightmost output column is filled with the proper "Gray" #74705D color. The output of colortool -c in PowerShell 7, seen in the bottom half of the image, appears correct for all foreground color rows and background color columns.

Get-PSReadLineOptions
bugreport terminal e 37m 2
Note the CommentColor value of "`e[0;37m" (the 0; added in there for overkill while I was trying to debug this issue myself). Windows Terminal prints the output of this line once again in "Bright White" #F8F8F2, despite my $PROFILE explicitly setting the PSReadLineOption Color for "Comment" to "`e[0;37m" (previously "Gray", but I tried switching to escape codes in case it made a difference — it did not). Once again, the output from PowerShell 7 appears to be correct. It seems that Windows Terminal does not care for printing text with foreground color "Gray"? Additionally, both images show a "bonus" repro in the prompt: the triangular character between the date and the time is generated via Write-Host "" -BackgroundColor "DarkGray" -ForegroundColor "Gray" -NoNewline, so once again a foreground color of "Gray" seems to be failing here.

Originally created by @IarwainBen-adar on GitHub (May 26, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18363.0 Windows Terminal version (if applicable): 1.0.1401.0 Additional software: PowerShell 7 version 7.0.1; ColorTool 1904.29002 ``` # Steps to reproduce Use `ColorTool -c` and/or `Get-PSReadLineOptions` to show current color settings. Observe that the color "Gray" is rendered incorrectly (but seemingly only used as a foreground color — background color "Gray" appears to be fine!) in Windows Terminal. For the sake of completeness, just in case I am missing something obvious, this is the color scheme I am using: ``` { "name": "Monokai", "foreground": "#F8F8F2", "background": "#282923", "cursorColor": "#F8F8F2", "black": "#282923", "red": "#F83535", "green": "#537115", "yellow": "#FD9621", "blue": "#0087AF", "purple": "#7356AB", "cyan": "#56AB81", "white": "#74705D", "brightBlack": "#48473D", "brightRed": "#F92472", "brightGreen": "#A6E22C", "brightYellow": "#E7DB74", "brightBlue": "#67D8EF", "brightPurple": "#AC80FF", "brightCyan": "#67D8EF", "brightWhite": "#F8F8F2" } ``` # Expected behavior I would expect the color "Gray" to print correctly and consistently for both foreground and background. Powershell 7.0.1 prints "Gray" as I expect. # Actual behavior See attached screenshots. In each image, two windows are stacked vertically: Windows Terminal above and PowerShell 7 underneath. **ColorTool:** ![bugreport terminal e 37m](https://user-images.githubusercontent.com/65730198/82867659-188d5580-9ee0-11ea-9d54-78d3dcea361e.png) Note the bottom two output rows from `colortool -c`. Windows Terminal prints the `37m` line as color `#F8F8F2` (the same color as the `1;37m` row), rather than using the scheme-correct color `#74705D`. Yet Windows Terminal clearly understands that the color `#74705D` is defined in the scheme as "Gray" — the background of the rightmost output column is filled with the proper "Gray" `#74705D` color. The output of `colortool -c` in PowerShell 7, seen in the bottom half of the image, appears correct for all foreground color rows and background color columns. **Get-PSReadLineOptions** ![bugreport terminal e 37m 2](https://user-images.githubusercontent.com/65730198/82869626-6c4d6e00-9ee3-11ea-8a57-8cb1e278a8ee.png) Note the `CommentColor` value of ``"`e[0;37m"`` (the `0;` added in there for overkill while I was trying to debug this issue myself). Windows Terminal prints the output of this line once again in "Bright White" `#F8F8F2`, despite my `$PROFILE` explicitly setting the `PSReadLineOption` Color for "Comment" to ``"`e[0;37m"`` (previously "Gray", but I tried switching to escape codes in case it made a difference — it did not). Once again, the output from PowerShell 7 appears to be correct. It seems that Windows Terminal does not care for printing text with foreground color "Gray"? Additionally, both images show a "bonus" repro in the prompt: the triangular character between the date and the time is generated via `Write-Host "" -BackgroundColor "DarkGray" -ForegroundColor "Gray" -NoNewline`, so once again a foreground color of "Gray" seems to be failing here.
claunia added the Resolution-Duplicate label 2026-01-31 01:33:20 +00:00
Author
Owner

@DHowett commented on GitHub (May 26, 2020):

Thanks for the report! This is a subtly different version of #293 #2661 😄

It’ll be fixed when 2661 is.

/dup #2661

@DHowett commented on GitHub (May 26, 2020): Thanks for the report! This is a subtly different version of #293 #2661 :smile: It’ll be fixed when 2661 is. /dup #2661
Author
Owner

@ghost commented on GitHub (May 26, 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 (May 26, 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#8592