Text rendering error with foreground color "White" (aka PowerShell color "Gray" aka ANSI "e[0;37m") #6197
Labels
Resolution-Duplicate
There's another issue on the tracker that's pretty much the same thing.
Environment
Steps to reproduce
Use
ColorTool -c
and/orGet-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:
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:
Note the bottom two output rows from
colortool -c
. Windows Terminal prints the37m
line as color#F8F8F2
(the same color as the1;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 ofcolortool -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
Note the
CommentColor
value of"`e[0;37m"
(the0;
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 thePSReadLineOption
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 viaWrite-Host "" -BackgroundColor "DarkGray" -ForegroundColor "Gray" -NoNewline
, so once again a foreground color of "Gray" seems to be failing here.The text was updated successfully, but these errors were encountered: