[FEATURE] Custom themes: add selectionFg so selected text color can be set alongside selectionBg

Status Open
Reported on v2.1.287
Maintainer reply None cached
Activity 0 comments · opened Oct 2, 2026

Summary

Custom themes can override selectionBg, but there is no matching key for the foreground of selected text. When text is selected, Claude Code replaces the cell's background (and drops inverse) but keeps each cell's original foreground color. That makes any bright selection color unreadable on a dark theme.

Steps to reproduce

  1. Create ~/.claude/themes/test.json:

``json
{
"name": "Test",
"base": "dark-daltonized",
"overrides": { "selectionBg": "#ffd60a" }
}
``

  1. Set "theme": "custom:test" in ~/.claude/settings.json.
  2. Select text with the mouse.

Expected

A way to set the selected-text foreground, so a bright highlight can be paired with dark text (e.g. #ffd60a background with #000000 text, a common terminal selection scheme).

Actual

Selected text keeps the theme's light foreground. White on #ffd60a is about 1.4:1 contrast, well under the WCAG AA minimum of 4.5:1. The only workaround is a dark selection background (e.g. #7a5f00, about 6:1), which rules out bright highlight colors on dark themes.

Proposal

Add an optional selectionFg theme key. When set, selected cells use it as the foreground; when unset, behavior stays as it is today.

Environment

  • Claude Code 2.1.287
  • macOS (Apple Terminal, xterm-256color)
  • Base theme: dark-daltonized

View original on GitHub ↗