You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
invisible text when using light theme: dark text over dark textarea #16411
What terminal emulator and version are you using (if applicable)?
COSMIC Terminal
What issue are you seeing?
when i run codex on light theme i see the following
but in dark theme i see
which is correct.
In other words: light theme makes codex 1. use a dark background for the input area, 2. put a seemingly random white letter in that area, 3. display the suggested text and any text i write in dark as well, so i don't see it. That means I can only use codex with dark theme.
Same on Windows. I measured it per-pixel so the numbers are concrete.
Environment
codex-cli 0.150.1, Windows 11 (10.0.26200), Windows Terminal
Color scheme: built-in Solarized Light (background #FDF6E3)
AppsUseLightTheme = 1 and SystemUsesLightTheme = 1 — Windows is in light mode
Measured from a screenshot
Terminal background
#FDF6E3
Composer background
#292929
Composer text
#657B83 — the terminal's own default foreground
Codex paints the composer background but leaves the text at the terminal's default
foreground, which is tuned for a light background. That is what makes it unreadable
rather than merely out of place.
Contrast ratios:
#657B83 on #292929 → 3.27:1 (fails WCAG AA 4.5:1)
#657B83 on #FDF6E3 → 4.13:1 (everywhere else in the TUI)
No terminal-side fix exists.#292929 is neither in the xterm-256 palette
(235 = #262626, 236 = #303030) nor in Solarized, so it is emitted as truecolor
and cannot be remapped by the terminal. Changing the terminal foreground cannot work
either, because the two backgrounds sit at opposite ends:
reaching 4.5:1 on #FDF6E3 requires relative luminance L ≤ 0.166
reaching 4.5:1 on #292929 requires L ≥ 0.275
No single foreground colour satisfies both.
Tested and does not help
COLORFGBG=0;15 — composer stays #292929, text unchanged
codex --no-alt-screen — same
[tui] theme — appears to be syntect syntax themes only (the value list is
syntect's bundled set, and the TUI event is SyntaxThemeSelected); it does not
touch the composer
Windows light mode is already on and is evidently not consulted
The only thing that works is NO_COLOR=1, which removes the composer background
entirely and makes the whole TUI readable — but it also disables diff and syntax
colours, so it is not usable day to day.
Ask: either honour the OS/terminal light mode on Windows the way macOS already
does (#18942 reports the light composer does render there after a restart), or expose
an explicit override such as [tui] theme_mode = "light" | "dark" or a --theme flag.
Still reproducible on 0.164.0 (Linux, Codex running inside a terminal that answers OSC 10/11 and supports DEC mode 2031).
Codex reads the terminal's default colors once at startup and caches them. A theme switch while Codex is running leaves the composer drawn for the old background: dark-on-dark after switching to light, and light-on-light the other way. Restarting Codex picks up the new colors.
What we measured, driving codex 0.164.0 in a pty:
At startup it sends OSC 10;? and OSC 11;? once. Answering rgb:fafa/fafa/fafa gives a light composer (48;2;240;240;240); answering rgb:1010/1010/1010 gives a dark one (48;2;44;44;44).
After startup, no event makes it query again: not a focus change (CSI O / CSI I, with focus reporting on), not a resize (SIGWINCH), and not a color-scheme report (CSI ? 997 ; 1 n).
The focus re-query (#4673) was removed in 976129f (#35649), with the reason given in event_stream.rs: querying on focus blocks the input loop and can drop keys typed during the refresh. That tradeoff makes sense.
Suggestion: follow DEC private mode 2031 (color-palette update notifications) instead. Codex would set CSI ? 2031 h at startup. The terminal then sends CSI ? 997 ; 1 n (dark) or CSI ? 997 ; 2 n (light) only when the scheme actually changes, so the palette would be re-queried at that moment and never on focus. Normal typing would never trigger a probe. Claude Code (theme auto) and OpenCode (theme system) already subscribe to this mode, and both follow a live theme switch in the same terminal where Codex does not.
Thanks for the screenshots. Older versions of COSMIC Terminal reported a black background to Codex even in light mode. Updating COSMIC Terminal to epoch-1.2.0 or later and relaunching Codex should make the input readable. COSMIC fix
I tested Codex 0.118.0 and 0.171.0 on Linux. Both drew the exact dark gray input background from your screenshot (#1e1e1e) when the terminal reported black. When I changed only the terminal’s reply to report the light background shown in your screenshot, both drew a readable light input area.
Closing this as fixed upstream for the original COSMIC startup issue. If the input becomes unreadable when you switch themes while Codex is running, I reproduced that on 0.171.0 and we’re tracking it in #45163.
Activity
github-actions commentedon Apr 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
cynicalight commentedon Apr 22, 2026
i exit and reopen, the input area renders correct theme
cyhbench commentedon Aug 28, 2026
Same on Windows. I measured it per-pixel so the numbers are concrete.
Environment
background #FDF6E3)AppsUseLightTheme = 1andSystemUsesLightTheme = 1— Windows is in light modeMeasured from a screenshot
#FDF6E3#292929#657B83— the terminal's own default foregroundCodex paints the composer background but leaves the text at the terminal's default
foreground, which is tuned for a light background. That is what makes it unreadable
rather than merely out of place.
Contrast ratios:
#657B83on#292929→ 3.27:1 (fails WCAG AA 4.5:1)#657B83on#FDF6E3→ 4.13:1 (everywhere else in the TUI)No terminal-side fix exists.
#292929is neither in the xterm-256 palette(235 =
#262626, 236 =#303030) nor in Solarized, so it is emitted as truecolorand cannot be remapped by the terminal. Changing the terminal foreground cannot work
either, because the two backgrounds sit at opposite ends:
#FDF6E3requires relative luminance L ≤ 0.166#292929requires L ≥ 0.275No single foreground colour satisfies both.
Tested and does not help
COLORFGBG=0;15— composer stays#292929, text unchangedcodex --no-alt-screen— same[tui] theme— appears to be syntect syntax themes only (the value list issyntect's bundled set, and the TUI event is
SyntaxThemeSelected); it does nottouch the composer
The only thing that works is
NO_COLOR=1, which removes the composer backgroundentirely and makes the whole TUI readable — but it also disables diff and syntax
colours, so it is not usable day to day.
Ask: either honour the OS/terminal light mode on Windows the way macOS already
does (#18942 reports the light composer does render there after a restart), or expose
an explicit override such as
[tui] theme_mode = "light" | "dark"or a--themeflag.Related: #18942, #21130, #27333, #2020 (closed), plus the duplicates the bot flagged
above: #14996, #15736, #16165.
hiukky commentedon Oct 27, 2026
Still reproducible on 0.164.0 (Linux, Codex running inside a terminal that answers OSC 10/11 and supports DEC mode 2031).
Codex reads the terminal's default colors once at startup and caches them. A theme switch while Codex is running leaves the composer drawn for the old background: dark-on-dark after switching to light, and light-on-light the other way. Restarting Codex picks up the new colors.
What we measured, driving
codex0.164.0 in a pty:OSC 10;?andOSC 11;?once. Answeringrgb:fafa/fafa/fafagives a light composer (48;2;240;240;240); answeringrgb:1010/1010/1010gives a dark one (48;2;44;44;44).CSI O/CSI I, with focus reporting on), not a resize (SIGWINCH), and not a color-scheme report (CSI ? 997 ; 1 n).The focus re-query (#4673) was removed in 976129f (#35649), with the reason given in
event_stream.rs: querying on focus blocks the input loop and can drop keys typed during the refresh. That tradeoff makes sense.Suggestion: follow DEC private mode 2031 (color-palette update notifications) instead. Codex would set
CSI ? 2031 hat startup. The terminal then sendsCSI ? 997 ; 1 n(dark) orCSI ? 997 ; 2 n(light) only when the scheme actually changes, so the palette would be re-queried at that moment and never on focus. Normal typing would never trigger a probe. Claude Code (themeauto) and OpenCode (themesystem) already subscribe to this mode, and both follow a live theme switch in the same terminal where Codex does not.etraut-openai commentedon Nov 21, 2026
(response from codex)
Thanks for the screenshots. Older versions of COSMIC Terminal reported a black background to Codex even in light mode. Updating COSMIC Terminal to
epoch-1.2.0or later and relaunching Codex should make the input readable. COSMIC fixI tested Codex 0.118.0 and 0.171.0 on Linux. Both drew the exact dark gray input background from your screenshot (
#1e1e1e) when the terminal reported black. When I changed only the terminal’s reply to report the light background shown in your screenshot, both drew a readable light input area.Closing this as fixed upstream for the original COSMIC startup issue. If the input becomes unreadable when you switch themes while Codex is running, I reproduced that on 0.171.0 and we’re tracking it in #45163.