Skip to content

Support for light-background terminals #2020

@jxy

Description

@jxy

Problem

Codex CLI hard-codes colours optimised for dark backgrounds, making prompts, completions and menus almost invisible when the terminal uses a light background. Users must either invert their entire terminal theme, or forego Codex altogether. That clashes with Codex’s goal of “runs in your terminal” and hurts day-to-day usability.

Impact

  • Accessibility – developers who rely on light themes for reduced eye-strain or colour-vision requirements cannot read the interface.
  • Adoption – teams with enforced light corporate themes (common in financial and healthcare environments) simply skip Codex.
  • Consistency – every major TUI framework (ratatui, rich, xterm.js) ships both dark and light palettes. Codex is the outlier.

Proposal

  1. Theme selection

    • Add theme = "light" | "dark" in ~/.codex/config.{json,toml} (default to auto-detect via $COLORFGBG, $TERM_PROGRAM_BACKGROUND, or Windows registry).
    • Expose --theme flag for quick overrides.
  2. Palette definition

    • Replace hard-coded ANSI names with semantic tokens (e.g. primary, accent, error).
    • Provide two JSON/TOML palettes shipped in the repo; load at startup.
  3. Auto-test

    • CI job renders the TUI in both palettes and checks contrast ratios ≥ 4.5 : 1 (WCAG AA).
  4. Migration

    • Keep existing colours as the “dark” palette; no breaking changes.

Prior art

  • Ink Select component already uses an internal theming object – this can be extended.
  • Ratatui examples show palette switching in < 20 LOC; no heavy refactor needed.

Acceptance criteria

  • All UI elements (input box, slash-command menu, status bar, onboarding screens) render legibly on a white background.
  • codex --theme light works without touching global terminal settings.
  • Documentation updated in Configuration section.

Links


Codex already delights on dark screens; adding a light theme would make it universal, accessible and ready for every workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions