PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

PSRL 2.0.0-beta2 not setting defaults for OperatorColor and ParameterColor

Open rkeithhill opened this issue 7 years ago • 6 comments

Environment data

PS version: 6.1.0-preview.4
PSReadline version: 2.0.0-beta2
os: Linux HILLR2 4.4.0-18204-Microsoft #1001-Microsoft Sat Jul 21 16:57:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
PS file version:

Steps to reproduce or exception report

  1. Install powershell-preview (6.1.0-p4) on Ubuntu 18.04 running in WSL (Windows 10 1803)

  2. Run pwsh-preview and type in a command with a parameter and you won't see the -Name in this case: image

Here's why -

image

Note how both the OperatorColor and ParameterColor have not been set to a default. Hmm, just repro'd this on Windows 10 itself with 6.1.0-p4 installed. Is this an issue with how PowerShell configures PSRL? Or a problem with PSRL's defaults? Or is this supposed to work with those two values not set?

rkeithhill avatar Aug 10 '18 17:08 rkeithhill

There is a default value here but it apparently matches the background.

lzybkr avatar Aug 10 '18 18:08 lzybkr

Indeed for some reason the default color palette that I get with WSL on this Windows 10 machine has color index 8 (DarkGray - selected in the image below) set to the same color as index 0:

image

rkeithhill avatar Aug 10 '18 20:08 rkeithhill

It could be related to my use of colortool - applying the OneHalfDark color scheme.

rkeithhill avatar Aug 10 '18 20:08 rkeithhill

Maybe one fix would be to check every default "foreground" color to make sure it isn't the same as the current "background" color. And if so, adjust to another color that is different than the background color. And if on a VT system, maybe even use a computed contrast 8bit color.

rkeithhill avatar Oct 17 '18 01:10 rkeithhill

That might help a little, but I think more often the problem will be having colors that are too similar, and there is no portable way to determine the RGB values for the standard colors.

lzybkr avatar Oct 17 '18 01:10 lzybkr

Confirmed the same DarkGray or e[90m so this is likely still an issue (unless WSL has changed their background) I dont have a way to test WSL very easily

StevenBucher98 avatar Nov 06 '23 17:11 StevenBucher98