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

Write-Host -ForegroundColor Gray Shows Whatever The Supplied Foreground Color in Scheme is #9590

Closed
CamRatliff opened this issue Mar 23, 2021 · 2 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@CamRatliff
Copy link

Windows Terminal version (or Windows build number)

1.6.105671.0

Other Software

PS 7.1.3

Steps to reproduce

Write-Host "Hello world!" -ForegroundColor DarkGray
Write-Host "Hello world!" -ForegroundColor Gray
Write-Host "Hello world!" -ForegroundColor White

Expected Behavior

Write-Host -ForegroundColor Gray "Hello world!" returns a string formatting using the Gray (White or BrightBlack?) color as defined in the console.

Actual Behavior

Strings formatted with -ForegroundColor Gray are whatever the console's Foreground color is defined as, in the color scheme JSON of the WT theme.

When using Write-Host with -ForegroundColor Gray, Windows Terminal uses the Foreground key from the Color Theme's JSON to determine the color, instead of the White key.

Here is a screenshot with the defaults as the theme
image

Here is a screenshot with the foreground key turned off
image

Here is a screenshot using White as the foreground key
image

Here is a screenshot using Red as the foreground key
image

Here is a screenshot using Cyan as the brightBlack key
image

image
Here's a screenshot with the foreground key turned off, and the Powershell console's foreground set to white.

Finally, here's a screenshot with the foreground key set to Red, and the Powershell console's foreground set to white.
image

@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 Mar 23, 2021
@DHowett
Copy link
Member

DHowett commented Mar 23, 2021

Thanks for the comprehensive report. This boils down to how we handle compatibility with poorly-behaved powershell versions.

Unfortunately, this is by design. PowerShell erroneously tells us to use a black background and gray foreground so often that it would cause there to be black streaks across the display (even if the terminal background was set to white or acrylic transparency) and your preferred foreground color to be ignored.

We had to disable gray foreground and black background for PowerShell, specifically. #6810. Tracking the "fix" in /dup #6807.

@ghost
Copy link

ghost commented Mar 23, 2021

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 Mar 23, 2021
@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 Mar 23, 2021
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