microsoft / microsoft/TypeScript

Some colors make error messages hard to read on white backgrounds.

Open Beginner friendly
#63,648 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
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:

Image
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):

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:

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.