Skip to content

Predictive IntelliSense's text color is inaccessible #3477

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

Closed
3 tasks done
Tyriar opened this issue Nov 11, 2022 · 2 comments · Fixed by #3493
Closed
3 tasks done

Predictive IntelliSense's text color is inaccessible #3477

Tyriar opened this issue Nov 11, 2022 · 2 comments · Fixed by #3493

Comments

@Tyriar
Copy link

Tyriar commented Nov 11, 2022

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

cc @daxian-dbw @SteveL-MSFT

I just started seeing this feature described in #1468 and n noticed that it has hardcoded indexed color 238 (#444444), if you only set the foreground color to a fixed color it will have wildly varying levels of contrast depending on the terminal theme's background color, unless you also set the background color.

Prediction looks like it's regular input with #fff bg, #444 fg:

image

xterm.js' default demo theme is extremely low contrast, #2D2E2C bg, #F8F8F8 fg:

image

Prediction is invisible with #444 bg color:

image

I notice you can set the color manually via Set-PSReadLineOption -Colors @{ Prediction = '#8A0303'} but saying this is a good default and enough is a copout imo. Some users won't even know it's a feature because they can't see the text, and some users will think the shell is broken because it looks like regular text.

VS Code's minimum contrast feature actually prevents this contrast issue, however it brings another problem where it can more easily look like the default text color:

image

Considering this case, I think you should use the dim attribute by default to style the text while still allowing manual tweaking in psreadline options and in xterm.js we should exclude the dim attribute from the minimum contrast demands (or halve them).

Environment data

PS Version: 7.3.0
PS HostName: ConsoleHost
PSReadLine Version: 2.2.6
PSReadLine EditMode: Windows
OS: 10.0.22621.1 (WinBuild.160101.0800)
BufferWidth: 148
BufferHeight: 19

Steps to reproduce

Type git

Expected behavior

The prediction has reasonable contrast and is differentiated enough from the default foreground color, regardless of the terminal's background color.

Actual behavior

It can range from completely invisible to identical to the regular input.

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 11, 2022
@Tyriar
Copy link
Author

Tyriar commented Nov 14, 2022

Arguments are the same color as the prediction as well?

Recording 2022-11-14 at 11 09 42

@ghost ghost added the In-PR A PR is opened targeting the issue label Nov 23, 2022
@ghost ghost added Resolution-Fixed and removed In-PR A PR is opened targeting the issue Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Nov 23, 2022
@ghost
Copy link

ghost commented Mar 8, 2023

🎉 This issue was addressed in 3493, which has now been successfully released in v2.3.0-beta0. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant