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

Open
opened 2026-01-31 03:35:01 +00:00 by claunia · 0 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:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13150