PSReadLine colors and schemes #4651

Closed
opened 2026-01-30 23:53:06 +00:00 by claunia · 9 comments
Owner

Originally created by @musm on GitHub (Oct 25, 2019).

Environment

Windows build number: 10.0.18362.0

Steps to reproduce

Set-PSReadLineOption -Colors @{
    "Command" = [ConsoleColor]::Yellow
}

in scheme change color for powershell / pwsh .exe

            "brightYellow": "#F9F1A5",

Expected behavior

yellow should change the [ConsoleColor]::Yellow color but does not

Originally created by @musm on GitHub (Oct 25, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18362.0 ``` # Steps to reproduce ``` Set-PSReadLineOption -Colors @{ "Command" = [ConsoleColor]::Yellow } ``` in scheme change color for powershell / pwsh .exe ``` "brightYellow": "#F9F1A5", ``` # Expected behavior yellow should change the [ConsoleColor]::Yellow color but does not
claunia added the Resolution-DuplicateProduct-Terminal labels 2026-01-30 23:53:06 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Oct 25, 2019):

I'm having a hard time reproing any bug here. If you change the brightYellow property of the powershell profile's color scheme, it definitely updates for me:

image

Here I've changed brightYellow from it's default value of #f9f1a5 to #ff00ff, and you can see it's updated in the powershell tab.

@zadjii-msft commented on GitHub (Oct 25, 2019): I'm having a hard time reproing any bug here. If you change the `brightYellow` property of the powershell profile's color scheme, it definitely updates for me: ![image](https://user-images.githubusercontent.com/18356694/67588655-3b724400-f71c-11e9-8a9c-fa4c8faaeebb.png) Here I've changed `brightYellow` from it's default value of `#f9f1a5` to `#ff00ff`, and you can see it's updated in the powershell tab.
Author
Owner

@musm commented on GitHub (Oct 25, 2019):

The problem is why does "brightYellow" and not simply "Yellow" change [ConsoleColor]::Yellow ?

@musm commented on GitHub (Oct 25, 2019): The problem is why does `"brightYellow"` and not simply `"Yellow"` change `[ConsoleColor]::Yellow` ?
Author
Owner

@musm commented on GitHub (Oct 25, 2019):

Is this because [ConsoleColor]::DarkYellow is mean to be changed by "Yellow" and
[ConsoleColor]::Yellow is mean to be changed by "BrightYellow" ?

@musm commented on GitHub (Oct 25, 2019): Is this because `[ConsoleColor]::DarkYellow` is mean to be changed by "Yellow" and `[ConsoleColor]::Yellow` is mean to be changed by "BrightYellow" ?
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 25, 2019):

There's some discussion around color names in #2641. To match more closely with ANSI ECMA-48 standard color names, we're departing from the ConsoleColor enum.

@DHowett-MSFT commented on GitHub (Oct 25, 2019): There's some discussion around color names in #2641. To match more closely with ANSI ECMA-48 standard color names, we're departing from the `ConsoleColor` enum.
Author
Owner

@musm commented on GitHub (Oct 25, 2019):

image

@DHowett which ENUM do you reccomend then when coloring items in powershell and psreadline ?

@musm commented on GitHub (Oct 25, 2019): ![image](https://user-images.githubusercontent.com/4319522/67590095-17b4fb00-f728-11e9-90c7-16f1daf91550.png) @DHowett which ENUM do you reccomend then when coloring items in powershell and psreadline ?
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 25, 2019):

For PowerShell Core (or anything else consuming PSReadline 2), you should prefer to use escape sequences to set your colors -- it's better-supported than ConsoleColor everywhere.

Set-PSReadLineOption -Colors @{
    "Command" = "`e[93m"
}
Write-Host "`e[96mSup`e[m"
@DHowett-MSFT commented on GitHub (Oct 25, 2019): For PowerShell Core (or anything else consuming PSReadline 2), you should prefer to use escape sequences to set your colors -- it's better-supported than `ConsoleColor` _everywhere_. ```powershell Set-PSReadLineOption -Colors @{ "Command" = "`e[93m" } ``` ``` Write-Host "`e[96mSup`e[m" ```
Author
Owner

@musm commented on GitHub (Oct 25, 2019):

Ok regardless the names are super confusing, since they don't correspond to the names here https://en.wikipedia.org/wiki/ANSI_escape_code

@musm commented on GitHub (Oct 25, 2019): Ok regardless the names are super confusing, since they don't correspond to the names here https://en.wikipedia.org/wiki/ANSI_escape_code
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 25, 2019):

I mean, apart from purple/magenta the Windows Terminal settings do correspond to those names? That's called out in https://github.com/microsoft/terminal/issues/2641#issuecomment-527247390.

ConsoleColor cannot be changed. It was created for a different, Windows-only, world. We're not in that world any longer.

Let's continue the discussion in /dup #2641.

@DHowett-MSFT commented on GitHub (Oct 25, 2019): I mean, apart from `purple`/`magenta` the Windows Terminal settings _do_ correspond to those names? That's called out in https://github.com/microsoft/terminal/issues/2641#issuecomment-527247390. ConsoleColor cannot be changed. It was created for a different, Windows-only, world. We're not in that world any longer. Let's continue the discussion in /dup #2641.
Author
Owner

@ghost commented on GitHub (Oct 25, 2019):

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 (Oct 25, 2019): 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#4651