microsoft / microsoft/terminal
Something is, well, probably fine with One half light
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
From a mail thread with @jazzdelightsme and @oldnewthing

>
> Repro:
> 1. set theme for cmd to “One Half Light”
> 2. set the “automatically adjust lightness” feature to “always”
> 3. open a new cmd tab
> 4. run “pwsh” or “powershell”
> 5. run “Get-PSReadLineOption”, and notice that several of the colors are invisible (notably the DefaultTokenColor).
---
This is Terminal 1.18, with One Half Light. I’ve typed `git do the thing`.

Left: `"adjustIndistinguishableColors": "never", `
right: `"adjustIndistinguishableColors": "always", `
wait, what’s going on here?

And the output of conpty looks pretty normal, too. After typing the `o` in `git do`, Terminal gets:
`␛[?25l␛[93m␛[36;27Hgit␣␛[37mdo␣␣␛[36;33H␛[?25h␛[m`
Which is basically:
• Turn cursor off
• Use bright yellow FG
• Cursor to the start of the prompt
• “git “
• Use dark white FG
• “do “ (two spaces)
• Move the cursor back a space, turn it back on, and reset the colors.
Which is exactly what I’d expect. So why is that appearing as white, and not black (which is what bright white is defined as) from the scheme?
Maybe I haven’t had enough coffee yet this morning.
----
Trawling through the colortool output, I noticed:
```
1;36m␛[38;5;14m␛[3C␣␣gYw␣␣␣␣␣gYw␣␣␣␛[48;5;1m␣␣gYw␣␣␛[49m␣␛[48;5;2m␣␣gYw␣␣␛[49m␣␛[48;5;3m␣␣gYw␣␣␛[49m␣␛[48;5;4m␣␣gYw␣␣␛[49m␣␛[?25l␛[m␛[38;5;14m␛[48;5;5m␣␣gYw␣␣␛[49m␣␛[48;5;6m␣␣gYw␣␣␛[49m␣␛[48;5;7m␣␣gYw␣␣␛[m␍␊
37m␛[5C␣␣gYw␣␣␣␣␣gYw␣␣␣␛[48;5;1m␣␣gYw␣␣␛[m␣␛[48;5;2m␣␣gYw␣␣␛[m␣␛[48;5;3m␣␣gYw␣␣␛[m␣␛[48;5;4m␣␣gYw␣␣␛[m␣␛[48;5;5m␣␣gYw␣␣␛[m␣␛[48;5;6m␣␣gYw␣␣␛[m␣␛[48;5;7m␣␣gYw␣␣␛[m␍␊
1;37m␛[38;5;15m␛[3C␣␣gYw␣␣␣␣␣gYw␣␣␣␛[48;5;1m␣␣gYw␣␣␛[49m␣␛[48;5;2m␣␣gYw␣␣␛[49m␣␛[48;5;3m␣␣gYw␣␣␛[49m␣␛[48;5;4m␣␣gYw␣␣␛[49m␣␛[48;5;5m␣␣gYw␣␣␛[49m␣␛[48;5;6m␣␣gYw␣␣␛[49m␣␛[48;5;7m␣␣gYw␣␣␛[21;1H␛]0;OHL,␣no␣adjust␇␛[?25h␛[m␛[30m␛[107m␍␊
```
* the `37m` line doesn't actually set the foreground color - I think it's relying on the `7` == "default index" thing.
* we're emitting all the colors as 256 color indicies?? good god
Maybe this is related to #15408
Contributor guide
Research direction
Start by reproducing the listed One Half Light scenario with adjustIndistinguishableColors set to always, then compare the rendered output with the conpty escape sequences and the never setting. Review the possible relationship to issue #15408; done means the PowerShell colors render according to the scheme without invisible or unexpectedly white tokens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, powershell
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100