Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
IarwainBen-adar opened this issue May 26, 2020 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@IarwainBen-adar
Copy link

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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 26, 2020
@DHowett
Copy link
Member

DHowett commented 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

@ghost
Copy link

ghost commented 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 ghost closed this as completed May 26, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 26, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants