Repository navigation
Closed
Labels
TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or requestNew feature or request
Description
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.
- Add
-
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.
- Replace hard-coded ANSI names with semantic tokens (e.g.
-
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: Control over color theme in TUI #1618
Codex already delights on dark screens; adding a light theme would make it universal, accessible and ready for every workflow.
Reacted by Feraidoon Mehri, casret, hodanov, Xing Shi Cai, Ngô Minh Khang, Scott, freddong, Robert, aaronweisberg, Kuniyoshi Koji and 51 more
Metadata
Metadata
Assignees
Labels
TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or requestNew feature or request
Activity
feat: add theme infrastructure for light/dark mode support
NightMachinery commentedon Aug 18, 2025
It's unreadable on Solarized Light.
imajes commentedon Aug 22, 2025
Completely agree; using during the day time can be obnoxious.
xzbdmw commentedon Sep 2, 2025
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 commentedon Sep 12, 2025
Agreed; it's very difficult to use Codex.
rr- commentedon Oct 16, 2025
Here's what it looks on my end – ridiculous
acgxv commentedon Oct 30, 2025
I’m experiencing the same issue, regardless of whether I change to any other light theme.
rr- commentedon Oct 30, 2025
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 commentedon Nov 2, 2025
Thanks, I already have a custom
CODEX_HOMEalias. It’s easy to expand it to:[-]Add first-class support for light-background terminals[/-][+]Support for light-background terminals[/+]babymastodon commentedon Dec 6, 2025
In case it helps, the issue is still reprodicible with the following configuration
ifnk commentedon Feb 4, 2026
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 commentedon Feb 18, 2026
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.
1 remaining item
DannyBen commentedon Mar 2, 2026
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 commentedon Mar 4, 2026
Same issue on 0.108.0 alpha
benswift commentedon Mar 4, 2026
Fwiw I did find a workaround in ghostty - set
minimum-contrast = 2and that fixes it (but not the underlying issue, obviously).veilm commentedon Mar 16, 2026
for me
TERM=dumbseems to fix the textarea and user messages, without losing color altogetherzolbayars commentedon Apr 23, 2026
Here's what it looks like when using the Clear Light theme (Mac Terminal):

DannyBen commentedon Apr 30, 2026
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 commentedon May 19, 2026
Seems like it was fixed on the latest version 🎉. Thanks all! 🙏
(btw, if you use something like Zellij, you should upgrade that too)
DannyBen commentedon May 19, 2026
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 commentedon May 29, 2026
I'm on 0.133 and still can't se half of the text in code blocks on my light theme.
DannyBen commentedon May 29, 2026
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.
NickeZ commentedon May 29, 2026
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.etraut-openai commentedon Aug 6, 2026
The TUI now detects terminal background brightness and selects light-compatible syntax/theme colors, with dedicated coverage.
DannyBen commentedon Aug 6, 2026
Maybe one background related fix was implemented. Syntax highlighting for me, with 0.146.1 - still has the same black background for all themes.
veilm commentedon Aug 7, 2026
Latest release looks good for me. I'm on the base16-256 theme and control my main terminal colorscheme through pywal.