-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Default color instead of white as foreground #13342
Comments
Actually, based on this image it looks like the black background is also not correct as it uses the default background color. |
You know what, looking closer, I'm betting this is the automatic lightness adjustment. Could you share your settings.json file/? |
MyTheme is the color scheme. {
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "splitPane",
"split": "right"
},
"keys": "ctrl+alt+2"
},
{
"command":
{
"action": "splitPane",
"split": "down"
},
"keys": "ctrl+alt+5"
}
],
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"profiles":
{
"defaults":
{
"colorScheme": "ADIX",
"font":
{
"face": "CaskaydiaCove NF"
},
"opacity": 80,
"useAcrylic": true
},
"list":
[
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore"
},
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "cmd"
},
{
"commandline": "gsudo \"C:\\Program Files\\PowerShell\\7\\pwsh.exe\"",
"guid": "{c3d1834f-b861-54a3-89fb-1c13f2363d95}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png",
"name": "PowerShell (admin)",
"startingDirectory": "%USERPROFILE%"
},
{
"commandline": "gsudo %SystemRoot%\\System32\\cmd.exe",
"guid": "{0ad3d447-8f3d-513c-99e1-447b1dcda84a}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
"name": "Command Prompt (admin)",
"startingDirectory": "%USERPROFILE%"
},
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{a3a2e83a-884a-5379-baa8-16f193a13b21}",
"hidden": false,
"name": "PowerShell 7 Preview",
"source": "Windows.Terminal.PowershellCore"
},
{
"guid": "{dc505395-c460-59d1-93a6-434a5808d193}",
"hidden": false,
"name": "Developer Command Prompt for VS 2022",
"source": "Windows.Terminal.VisualStudio"
},
{
"guid": "{d050a9e6-e1c2-5609-9f92-4c711743606d}",
"hidden": false,
"name": "Developer PowerShell for VS 2022",
"source": "Windows.Terminal.VisualStudio"
}
]
},
"schemes":
[
{
"background": "#002B36",
"black": "#171421",
"blue": "#2A7BDE",
"brightBlack": "#5E5C64",
"brightBlue": "#308DFF",
"brightCyan": "#33C7DE",
"brightGreen": "#33D17A",
"brightPurple": "#C061CB",
"brightRed": "#F66151",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFD00",
"cursorColor": "#FFFFFF",
"cyan": "#2AA1B3",
"foreground": "#839496",
"green": "#26A269",
"name": "MyTheme",
"purple": "#A347BA",
"red": "#C01C28",
"selectionBackground": "#FFFFFF",
"white": "#D0CFCC",
"yellow": "#CECB00"
},
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#FFFFFF",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#4F6066",
"blue": "#268BD2",
"brightBlack": "#47565C",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#000080",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#008080",
"foreground": "#C0C0C0",
"green": "#008000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
}
]
} |
Automatic lightness is disabled in all public builds... hmm. This looks like an explicit choice on behalf of the .NET folks, because it is totally possible using a non-.NET application to select the "white" color. |
I found this problem while using a custom prompt application (https://github.com/JanDeDobbeleer/oh-my-posh/) written in GO, so it is not a .NET specific thing. Can anyone with any programming language create a sample where white foreground looks as expected and not the default "foreground"? |
There is a process policy that applies only to powershell that translates White FG and Black BG to Default and Default, owing to a bug they shipped in Windows. That issue is documented in #6810. I suspect that is why Mike tested it with bash. Notably: this quirk only applies to executables named |
Meh, that's not why - I'm just quicker on the draw in |
It shouldn't be. Again, it only applies to executables named |
Hmmmmm, it might be the prompt app only generates the prompt as a string but at the end powershell is the one writing it... Also, it's funny, if you check my settings.json I have a profile for "admin powershell" with Disclamer: it's not my prompt app, I'm just using it. |
I'm under the impression that's exactly how oh-my-posh works. It just informs In the But Dustin's got a good point, the repro script above shouldn't be triggering this compat shim at all. That's weird. |
Is there anything I can use to disable this functionality? Some escape sequence at the beginning of the string? |
Unfortunately oh-my-posh does not support the 256-color palett. But it is a good idea, thank you, I will create a feature request there! |
Yes, oh-my-posh provides a string to PowerShell which writes it. I'm however not planning to add support for 256 colors as we already have hex support (which is 256) and tbh not many end users will want to/understand ANSI escape sequences. Adding that is also a challenge. Let me get the conditions straight. When in powershell and Windows Terminal, I should replace the two white colors with index 0 and 7? Because that I can do. If someone could help me map the right values, that would be ace. Right now we have the following:
|
Honestly, it might be better to wait for #13352 to land. You won't need to think about what colors should map to which indices any longer after that's been released broadly! For completeness, though: my original recommendation was going to be to map White FG to I'm gonna close this as a /dupe of #6807, since it looks like that's what it ended up being! |
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! |
Windows Terminal version
1.14.1451.0
Windows build number
10.0.19043.0
Other Software
No response
Steps to reproduce
With this tool you can render the color palett
Expected Behavior
When using white as foreground color, white ("white" attribute in scheme config) should be used instead of the "default" foreground ("foreground" attribute in scheme config)
Actual Behavior
Currently the default foreground color is used even when the foreground color is set to white.
After running in the attached snippet it is obvious that the white foreground (1st block 1st column last row) and the white background (2nd block 1st column last row) are not the same, on the other hand the first "Hello World" has the same colors as the one with white foreground (1st block 1st column last row)
The text was updated successfully, but these errors were encountered: