microsoft / microsoft/TypeScript
Some colors make error messages hard to read on white backgrounds.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
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, instead of using the default colors set by the terminal configuration (by writing 9x instead of 3x):
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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