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
- Theme selection
- Add
theme = "light" | "dark"in~/.codex/config.{json,toml}(default to auto-detect via$COLORFGBG,$TERM_PROGRAM_BACKGROUND, or Windows registry). - Expose
--themeflag for quick overrides.
- 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.
- Auto-test
- CI job renders the TUI in both palettes and checks contrast ratios ≥ 4.5 : 1 (WCAG AA).
- 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 lightworks 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.
23 Comments
<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.
Completely agree; using during the day time can be obnoxious.
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
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" />
<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
I’m experiencing the same issue, regardless of whether I change to any other light theme.
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.Thanks, I already have a custom
CODEX_HOMEalias. It’s easy to expand it to: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" />
please fix it , my eyes has problem ,must use light theme ,but codex input always is black ,i can't see input's text 😥
Adding a concrete repro for a mixed-theme input widget case.
Environment:
Observed behavior:
What I tried:
codex --no-alt-screen-> no changeTERM=xterm-256color COLORTERM= codex-> no reliable fixNO_COLOR=1 codex-> readable workaroundminimum-contrast = 2-> improves readability, but leaves input widget style visually inconsistent with the rest of the dark UIThis seems like a specific widget-level theme/contrast mismatch rather than a global dark/light preference issue.
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 Lighttheme, today everything is ok, v0.104This 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.
Same issue on 0.108.0 alpha
Fwiw I did find a workaround in ghostty - set
minimum-contrast = 2and that fixes it (but not the underlying issue, obviously).for me
TERM=dumbseems 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" />
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" />
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.
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" />
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.
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:
/themehave a light grey background for me (I guess they use white) - so they may be more usable for you.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=dumbfixes that.