Light (ANSI only) theme uses ANSI white for syntax, invisible on light terminals
Description
When using Light mode (ANSI colors only) (option 6 in /theme), code snippets and diffs render certain text elements using ANSI white (palette 7 / escape code 37). On light terminal themes, ANSI white is typically a very light color (close to the background), making this text invisible.
Affected elements
- Code punctuation:
(),{},;— rendered in ANSI white, invisible on light backgrounds - Deleted diff lines — struck-through text uses ANSI white, completely invisible
- Line numbers on certain lines
Steps to reproduce
- Use any light terminal theme where palette 7 (ANSI white) is a light/warm color (this is standard — Solarized Light, Catppuccin Latte, etc. all do this)
- Run
claudeand select/theme→ Light mode (ANSI colors only) - Make any code change to trigger a diff view
- Observe that punctuation and deleted lines are invisible
Why this happens
In the 16-color ANSI palette, slot 7 ("white") has different semantics depending on background:
- Dark themes: ANSI white = light foreground text (readable on dark bg)
- Light themes: ANSI white = a light/cream color, essentially a background-adjacent tone
Most terminal programs avoid using ANSI white as foreground text for this reason — they use the terminal's foreground setting instead. The light-ansi theme appears to map syntax elements to ANSI white, which breaks on any light terminal where palette 7 is light.
Expected behavior
The light-ansi theme should avoid using ANSI white (palette 7) for text elements that need to be readable. Use ANSI bright black (palette 8) or the terminal's default foreground instead.
Environment
- Claude Code: 2.1.86
- Terminal: Ghostty (but this affects any terminal with a standard light ANSI palette)
- OS: macOS
Screenshots will be added in a follow-up comment — gh CLI doesn't support image attachments.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗