You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doc to help users set PSReadLine colors and PowerShell colors for light themed terminal #9358
Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new Get-Foo cmdlet" instead of "New cmdlet."
PowerShell Version
7.3
Summary
The default colors for both PowerShell and PSReadLine are built expecting a dark background. However, some users may choose to use a light background with dark text. However, most of the default colors don't set the background, so in some cases the light foreground with the light background makes that text invisible. Users may not be aware they can change their colors to make the text visible. It seems we should just have some sample PS script for setting colors appropriate for light themed terminals they can then put in their $profile.
Not sure if it makes sense to have this as part of the ANSI topic or separate as users would need to know about ANSI to find it.
For what it's worth, I wholeheartedly believe that the DefaultTokenColor, TypeColor and ContinuationPromptColorshould be \e[39m. In almost all default color schemes on many terminals that color is the same as white (on dark-theme terminals) so it doesn't present too much of a compatibility issue. At the same time, it opens up the possibility that PSReadline automatically performs better on light-theme terminals. The cost is so low¹ and the benefit is so great² that we'd be remiss in not considering it.
¹ Terminals that do not support 39 and 49 are rare in the wild. Even the Windows Console supports it in its earliest versions. To quote PowerShell/PSReadLine#1626:
I went back to the Windows source code and confirmed: conhost supports 39;49 everywhere ENABLE_VIRTUAL_TERMINAL_PROCESSING is supported.
² The benefit is, "nobody will ever complain about this again." That doesn't even account for all the people who just leave or change shells or never learn that there is documentation telling them the "right" way to "fix" it. 😄
Dustin L. Howett (@DHowett) What do you think of these colors for a light theme? Most of these colors come directly from the ISE's light-mode configuration.
Activity
sdwheeler commentedon Oct 25, 2022
Steve Lee (@SteveL-MSFT) Do you have some sample themes we can document?
sdwheeler commentedon Oct 25, 2022
DHowett commentedon Nov 8, 2022
For what it's worth, I wholeheartedly believe that the
DefaultTokenColor,TypeColorandContinuationPromptColorshould be\e[39m. In almost all default color schemes on many terminals that color is the same as white (on dark-theme terminals) so it doesn't present too much of a compatibility issue. At the same time, it opens up the possibility that PSReadline automatically performs better on light-theme terminals. The cost is so low¹ and the benefit is so great² that we'd be remiss in not considering it.¹ Terminals that do not support
39and49are rare in the wild. Even the Windows Console supports it in its earliest versions. To quote PowerShell/PSReadLine#1626:² The benefit is, "nobody will ever complain about this again." That doesn't even account for all the people who just leave or change shells or never learn that there is documentation telling them the "right" way to "fix" it. 😄
sdwheeler commentedon Dec 6, 2022
Dustin L. Howett (@DHowett) What do you think of these colors for a light theme? Most of these colors come directly from the ISE's light-mode configuration.
Fixes #9358 - Add article about using light themes (#9539)
DHowett commentedon Dec 8, 2022
Sean Wheeler (@sdwheeler) hey, those look really good!