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

Closed
opened 2026-01-31 03:35:08 +00:00 by claunia · 2 comments
Owner

Originally created by @CamRatliff on GitHub (Mar 23, 2021).

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

Originally created by @CamRatliff on GitHub (Mar 23, 2021). ### 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](https://user-images.githubusercontent.com/25521654/112189524-182e1b80-8bd2-11eb-995b-49c68c162bba.png) Here is a screenshot with the foreground key turned off ![image](https://user-images.githubusercontent.com/25521654/112189272-d9986100-8bd1-11eb-98f1-13d9aefa1054.png) Here is a screenshot using White as the foreground key ![image](https://user-images.githubusercontent.com/25521654/112188925-77d7f700-8bd1-11eb-900d-fadb2cfad835.png) Here is a screenshot using Red as the foreground key ![image](https://user-images.githubusercontent.com/25521654/112189021-93430200-8bd1-11eb-8948-a98251d952de.png) Here is a screenshot using Cyan as the brightBlack key ![image](https://user-images.githubusercontent.com/25521654/112189146-b8d00b80-8bd1-11eb-96a7-d886bccb93d3.png) ![image](https://user-images.githubusercontent.com/25521654/112190281-d81b6880-8bd2-11eb-8554-b836bf6a3c37.png) 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](https://user-images.githubusercontent.com/25521654/112190604-292b5c80-8bd3-11eb-8189-4a24bcc8b8e9.png)
claunia added the Resolution-Duplicate label 2026-01-31 03:35:08 +00:00
Author
Owner

@DHowett commented on GitHub (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.

@DHowett commented on GitHub (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.
Author
Owner

@ghost commented on GitHub (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 commented on GitHub (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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13152