microsoft / microsoft/TypeScript
Some colors make error messages hard to read on white backgrounds.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- PR merge metrics
- PR metrics pending
Description
On a terminal with white background, some parts of the error messages are very hard to read:
### Cause
The problem is that the `diagnosticwriter` is forcing the [bright versions of the colors](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Pm-m:Ps-=-9-0.1E5F), instead of using the default colors set by the terminal configuration (by writing `9x` instead of `3x`):
https://github.com/microsoft/typescript-go/blob/168e7015edf98244febc8f4ae450b673b5d195d7/internal/diagnosticwriter/diagnosticwriter.go#L108-L112
If I patch the binary to replace the colors to `3x` with this:
```
$ sed -i 's/\x1b\[9\(.\)m/\x1b[3\1m/g' ./node_modules/@typescript/typescript-linux-x64/lib/tsc
```
Then the output is much easier to read:
Contributor guide
Research direction
Start in internal/diagnosticwriter/diagnosticwriter.go at the color-writing code linked in the issue, and compare the terminal sequences it emits with the reported white-background behavior. Verify the diagnostic output in a terminal using its default colors; done means the error messages remain readable without forcing bright color variants.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100