Support for light-background terminals

Open 💬 23 comments Opened Aug 8, 2025 by 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.
  1. 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.
  1. Auto-test
  • CI job renders the TUI in both palettes and checks contrast ratios ≥ 4.5 : 1 (WCAG AA).
  1. 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

  • Earlier feature request: #1618

---

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

View original on GitHub ↗

23 Comments

NightMachinery · 11 months ago

<img width="1280" height="751" alt="Image" src="https://github.com/user-attachments/assets/168ce597-ea1f-4016-bc25-b11697c89532" />

It's unreadable on Solarized Light.

imajes · 11 months ago

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

xzbdmw · 10 months ago

The black background and white foreground is hard coded in tui-markdown crate
https://github.com/joshka/tui-markdown/blob/f788f699c75cd3218e073db41b260d7c85194873/tui-markdown/src/lib.rs#L453

kevincojean · 10 months ago

Agreed; it's very difficult to use Codex.

<img width="678" height="855" alt="Image" src="https://github.com/user-attachments/assets/5d268ea2-2af2-484c-8821-b42f82f8593a" />

rr- · 9 months ago

<img width="835" height="456" alt="Image" src="https://github.com/user-attachments/assets/c2b0db7d-c6d2-4189-9387-2f249e479309" />

Here's what it looks on my end – ridiculous

acgxv · 8 months ago
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.

rr- · 8 months ago

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.

acgxv · 8 months ago

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'
babymastodon · 7 months ago

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

<img width="1520" height="742" alt="Image" src="https://github.com/user-attachments/assets/f6e28a71-fe1d-4b1d-b371-5afa4743dc5b" />

ifnk · 5 months ago

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

benswift · 5 months ago

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.

yegorLitvinov · 5 months ago

Yesterday had hard-to-read prompt problem similar to https://github.com/openai/codex/issues/2020#issuecomment-3620824254 in v0.101 in ghostty with Ayu Light theme, today everything is ok, v0.104

DannyBen · 4 months ago

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.

brunoalano · 4 months ago

Same issue on 0.108.0 alpha

benswift · 4 months ago

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

veilm · 4 months ago

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

<img width="1920" height="765" alt="Image" src="https://github.com/user-attachments/assets/bf93744e-7344-4c6a-8929-fdf3cd2e6be8" />

zolbayars · 2 months ago

Here's what it looks like when using the Clear Light theme (Mac Terminal):
<img width="710" height="252" alt="Image" src="https://github.com/user-attachments/assets/5c671abd-4c0b-4c07-a78a-17b8c2a24ba5" />

DannyBen · 2 months ago

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.

zolbayars · 2 months ago

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

<img width="724" height="229" alt="Image" src="https://github.com/user-attachments/assets/4abade7f-db27-42cf-8371-b4f1b7863942" />

DannyBen · 2 months ago
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.

NickeZ · 1 month ago

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

DannyBen · 1 month ago
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.

NickeZ · 1 month ago
> 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.