Use `SGR 1` for highlighted text to improve contrast in Microsoft Terminal
Describe the bug
For a long time, I've been struggling with the foreground color in k9s being way too light making it hard to read (especially for the selected/highlighted line) in Microsoft Terminal. After a lot of discussions first in k9s Slack and then in https://github.com/microsoft/terminal/issues/19376 it turns out that the issue is a clash between Microsoft Terminal's default setting for "Intense text style" being "Bright colors" and k9s outputting something else. Here's the useful info from someone that understands the details much better than I do:
I suspect k9s may be using
SGR 1(i.e. bold/bright), so the color in question is bright black. On lhecker's system,SGR 1is assumedly configured to use a bold font rather than bright colors, which is why the text just looks black, but the font appears to be bold.
https://github.com/microsoft/terminal/issues/19376#issuecomment-3339920853
To Reproduce
- Open WSL2 in Microsoft Terminal.
- Install k9s: https://k9scli.io/topics/install/
- Get yourself a Kubernetes cluster, e.g. via Minikube: https://minikube.sigs.k8s.io/docs/start/
- Run
k9s
Historical Documents
n/a
Expected behavior
It should look like this:
Screenshots
Versions (please complete the following information):
- WSL2
- Ubuntu 22.04
- k9s v0.50.12
Additional context
n/a
This issue is stale because it has been open for 30 days with no activity.
Ping
This issue is stale because it has been open for 30 days with no activity.
I'd really appreciate some input on this, it's pretty debilitating for k9s users in Microsoft Terminal…
@lindhe Agree it could do with a fix, but it's worth posting that there is a full workaround for this as shown in the microsoft terminal issue https://github.com/microsoft/terminal/issues/19376 where this was raised by you with them :-).
And the direct slack link to the k9s discussion is https://k9sers.slack.com/archives/CSHB3MR6G/p1759221799030109?thread_ts=1759150389.600939&cid=CSHB3MR6G
Yeah, I'm aware. It's relatively fine for me now, because I did eventually (after many days of debugging) get it working after getting advice from that thread about the work-around.
I mostly wanted to prevent GitHub bot from closing this issue automatically, since I was not sure if any maintainer had seen my issue. And while the work-around seems to work for me, someone else could have a scenario where they have another important tool that is broken by the work-around. And also I think other people should not have struggle with debugging k9s to find the work-around, it should "just work". 🙂