User-prompt turn background doesn't adapt to light terminal themes (renders near-black even on light backgrounds)
Summary
Claude Code styles user-prompt turns with a filled background block to distinguish them from assistant output — useful behaviour. However the block is rendered with a near-black background and light text regardless of terminal theme, so on light terminals it appears as a stark dark box against the otherwise-light window. It reads fine but looks visually inverted against the rest of the UI.
Expected on a light theme: user turn background in a light grey (e.g. #e6e6e6 / #eaeaea), with dark text — mirror of the dark-mode behaviour.
Reproduce
- Use any light terminal theme (GitHub Light Default, Catppuccin Latte, Gruvbox Light Hard — all exhibit this).
- Run
claudeand send a message. - Scroll back — your user turn sits inside a near-black rectangle while the rest of the conversation is on the light background.
Screenshot behaviour: the window, title bar, assistant text, and all surrounding UI render on a light background. Only the user-prompt block is inverted.
Why — likely root cause
Claude Code probably renders user turns either via:
- ANSI reverse-video (SGR 7), which swaps the terminal's current foreground and background — on a light terminal this produces dark fg on light bg which would look right, but the observed behaviour is the opposite, so probably not this; or
- A hardcoded dark colour (via RGB escapes or a fixed ANSI index) for the background, assuming the user is always on a dark theme.
Either way, the styling doesn't consult the detected background colour or adapt.
Suggested fixes
- Detect light vs. dark background at startup (OSC 11 query,
COLORFGBG, or terminal capability query) and pick an appropriate user-turn background accordingly — light grey on light themes, dark grey on dark themes. - Use SGR 7 (reverse video) for the user-turn block — the terminal handles the inversion correctly against whatever colours are active.
- Use a semantically-neutral approach: draw user-turn text in the terminal's default colours with a thin border / prefix indicator rather than a filled background block.
- Expose a config option (
userTurnBackground/userTurnStyle) so users can override while a proper fix is designed.
Related
Companion issue #49839 covers the related problem of Claude Code's dim/secondary text being unreadable on light themes because it uses ANSI bright-black. These two are separate render paths but share the same root cause — assumptions about background colour that hold on dark themes and fail on light ones.
Environment
- Claude Code 2.1.112
- Ghostty 1.2.3 (Wayland,
--gtk-single-instance=true) - KDE Plasma 6.4.5 with Breeze Light global theme
- Themes tested: GitHub Light Default, Catppuccin Latte, TokyoNight Day, Gruvbox Light Hard, Rose Pine Dawn — all show the same dark user-turn block on their light backgrounds.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗