Skip to content

Support for light-background terminals #2020

Closed

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.

Activity

  1. NightMachinery commented on Aug 18, 2025

    @NightMachinery
    Image

    It's unreadable on Solarized Light.

  2. imajes commented on Aug 22, 2025

    @imajes

    Completely agree; using during the day time can be obnoxious.

  3. xzbdmw commented on Sep 2, 2025

    @xzbdmw
  4. kevincojean commented on Sep 12, 2025

    @kevincojean

    Agreed; it's very difficult to use Codex.

    Image
  5. rr- commented on Oct 16, 2025

    @rr-
    Image

    Here's what it looks on my end – ridiculous

  6. added
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on Oct 27, 2025
  7. acgxv commented on Oct 30, 2025

    @acgxv

    Here's what it looks on my end – ridiculous

    I’m experiencing the same issue, regardless of whether I change to any other light theme.

  8. rr- commented on Oct 30, 2025

    @rr-

    After rebooting, it worked out by itself (?).
    Prior to that, I had to resort to export TERM=dumb – which disabled coloring altogether, along with other capabilities, and would cause bizarre issues after exiting Codex requiring me to restart active shell… but at least made it usable.

  9. acgxv commented on Nov 2, 2025

    @acgxv

    Thanks, I already have a custom CODEX_HOME alias. It’s easy to expand it to:

    alias cx='CODEX_HOME=${CODEX_HOME:-$( [ -d .codex ] && echo .codex || echo $HOME/.codex )} TERM=dumb codex'
    
  10. changed the title [-]Add first-class support for light-background terminals[/-] [+]Support for light-background terminals[/+] on Nov 14, 2025
  11. babymastodon commented on Dec 6, 2025

    @babymastodon

    In case it helps, the issue is still reprodicible with the following configuration

    Image
  12. ifnk commented on Feb 4, 2026

    @ifnk

    please fix it , my eyes has problem ,must use light theme ,but codex input always is black ,i can't see input's text 😥

  13. benswift commented on Feb 18, 2026

    @benswift

    Adding a concrete repro for a mixed-theme input widget case.

    Environment:

    • codex-cli 0.101.0
    • Ghostty terminal
    • Ghostty theme: Gruvbox Dark
    • TERM=xterm-ghostty, COLORTERM=truecolor

    Observed behavior:

    • Most of the Codex TUI renders light-on-dark as expected.
    • The input text widget renders dark text on a light background (or low-contrast light-on-slightly-lighter in some runs), so it looks like the widget is using a different palette/theme path than the rest of the UI.

    What I tried:

    • codex --no-alt-screen -> no change
    • TERM=xterm-256color COLORTERM= codex -> no reliable fix
    • NO_COLOR=1 codex -> readable workaround
    • Ghostty minimum-contrast = 2 -> improves readability, but leaves input widget style visually inconsistent with the rest of the dark UI

    This seems like a specific widget-level theme/contrast mismatch rather than a global dark/light preference issue.

  14. 1 remaining item

  15. DannyBen commented on Mar 2, 2026

    @DannyBen

    This has become worse in the last two releases (0.107.0) - many output elements are now on black background.... why not simply avoid setting background colors completely? or at least never set black or white background colors? With every release, some other element breaks in this regard.

  16. brunoalano commented on Mar 4, 2026

    @brunoalano

    Same issue on 0.108.0 alpha

  17. benswift commented on Mar 4, 2026

    @benswift

    Fwiw I did find a workaround in ghostty - set minimum-contrast = 2 and that fixes it (but not the underlying issue, obviously).

  18. veilm commented on Mar 16, 2026

    @veilm

    for me TERM=dumb seems to fix the textarea and user messages, without losing color altogether

    Image
  19. zolbayars commented on Apr 23, 2026

    @zolbayars

    Here's what it looks like when using the Clear Light theme (Mac Terminal):
    Image

  20. DannyBen commented on Apr 30, 2026

    @DannyBen

    The fact that this is still an issue may eventually drive users away. This nuisance plus the aggressive quota shrinkage, drove me to try the competition - and while I still like codex more, this kind of unhandled issues makes me question my allegiance.

  21. zolbayars commented on May 19, 2026

    @zolbayars

    Seems like it was fixed on the latest version 🎉. Thanks all! 🙏
    (btw, if you use something like Zellij, you should upgrade that too)

    Image
  22. DannyBen commented on May 19, 2026

    @DannyBen

    Seems like it was fixed on the latest version 🎉. Thanks all! 🙏

    Not fixed for me, version 0.131
    Everything is good (and has been for many versions), except the diffs shown while it edits the code. these have a black background. No matter which syntax highlighting theme I pick.

  23. NickeZ commented on May 29, 2026

    @NickeZ

    I'm on 0.133 and still can't se half of the text in code blocks on my light theme.

  24. DannyBen commented on May 29, 2026

    @DannyBen

    I'm on 0.133 and still can't se half of the text in code blocks on my light theme.

    For what its worth, as a workaround:

    1. Some themes in /theme have a light grey background for me (I guess they use white) - so they may be more usable for you.
    2. I changed my terminal settings to say that "ANSI Black" is set to nearly white. This makes the code blocks visible again, of course at the minor inconvenience that some other apps that use ANSI black for things (instead of "foreground") also get painted nearly white.

    This is an ugly and unacceptable hack, but it is the only way I could continue using codex.

  25. NickeZ commented on May 29, 2026

    @NickeZ

    I'm on 0.133 and still can't se half of the text in code blocks on my light theme.

    For what its worth, as a workaround:

    1. Some themes in `/theme` have a light grey background for me (I guess they use white) - so they may be more usable for you.
    
    2. I changed my terminal settings to say that "ANSI Black" is set to nearly white. This makes the code blocks visible again, of course at the minor inconvenience that some other apps that use ANSI black for things (instead of "foreground") also get painted nearly white.
    

    This is an ugly and unacceptable hack, but it is the only way I could continue using codex.

    Yeah, the theme "ansi" works fine when I have my terminal in both gruvbox-light and gruvbox-dark. gruvbox-dark however still has a light prompt box, TERM=dumb fixes that.

  26. etraut-openai commented on Aug 6, 2026

    @etraut-openai
    Contributor

    The TUI now detects terminal background brightness and selects light-compatible syntax/theme colors, with dedicated coverage.

  27. DannyBen commented on Aug 6, 2026

    @DannyBen

    Maybe one background related fix was implemented. Syntax highlighting for me, with 0.146.1 - still has the same black background for all themes.

    Image
  28. veilm commented on Aug 7, 2026

    @veilm

    Latest release looks good for me. I'm on the base16-256 theme and control my main terminal colorscheme through pywal.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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