question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prompt colors not configurable, not visible on white background

See original GitHub issue

Prerequisites

Steps to reproduce

The confirmation dialog uses white text which is not visible on white background. This color cannot by changed by any Set-PSReadLineOption or $PSStyle variable. The [Y] Yes uses light yellow which is barely visible (in fact never noticed it before taking screenshot) and everything else is completely white and therefore invisible to me.

I propose to add $PSStyle.Confirmation options, preferably Primary/Selected/Default, Other, Help and Text.

Expected behavior

# As rendered
> mkdir test
> '' > test/test.txt
> del test

Confirm
The item at /home/dkaszews/Downloads/test has children and the Recurse parameter was not specified. 
If you continue, all children will be removed with the item. Are you sure you want to continue?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Actual behavior

# As rendered
> mkdir test
> '' > test/test.txt
> del test

Confirm
The item at /home/dkaszews/Downloads/test has children and the Recurse parameter was not specified. 
If you continue, all children will be removed with the item. Are you sure you want to continue?
                                                             [?] Help (default is "Y"):

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.0-preview.3
PSEdition                      Core
GitCommitId                    7.3.0-preview.3-304-gd02c59addc24e13da3b8ee5e1a8e7aa27e00c745
OS                             Linux 5.15.0-1013-raspi #15-Ubuntu SMP PREEMPT Mon Aug 8 06:33:06 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

The [Y] Yes is barely visible as light yellow, all other values except [?] Help cannot be seen at all.

image

Selecting text reveals it.

image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dkaszewscommented, Aug 26, 2022

@jhoneill Fully agreed with what you say, and

Anything that says “The background is black, therefore yellow and white give good contrast” may fail when the RGB values for different colours are redefined. To cope with this I think we need a setting for PromptColor and PromptDefault colour. And the logical thing to do is to put it in PSStyle

is exactly what I would like to implement 😊

1reaction
dkaszewscommented, Aug 25, 2022

Setting $Host.UI.RawUI.BackgroundColor = White does fix the prompt, but causes other visual glitches due to ANSI ‘white’ being actually light gray and ‘BrightWhite’ not being a valid [System]::ConsoleColor.

Screenshot_20220825-190605~2

In general, I think we should retire all options using [System]::ConsoleColor and switch over to ANSI. This will fix such problems and enable more features like 256 and 24bit colors and bold fonts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 Background Solid Color White is not an ...
With Windows 10 under the solid color palette White is not an option and there is no option to define alternate colors. Can...
Read more >
Color for the PROMPT (just the PROMPT proper) in cmd. ...
I'm talking about the prompt proper, not the color of the foreground (text) or the background. And it's really easy in Bash and...
Read more >
How to change the dark blue in wsl to something brighter?
Start your WSL shell (for me that is ubuntu.exe); Right-click title bar and select "Properties"; Pretty dumb dialog appears where you have ...
Read more >
Colors
So if you see your prompt segments rendered with incorrect colors, and you are using a Palette, be sure to check the correctness...
Read more >
Terminal Appearance in Visual Studio Code
While the terminal is capable of displaying true color, programs commonly use 8 ANSI colors (black, red, green, yellow, blue, magenta, cyan and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found