Codex 0.130.0 still loses background/pill colors inside tmux 3.6a
What version of Codex CLI is running?
0.130.0
What subscription do you have?
Unknown / not relevant to rendering issue.
Which model were you using?
gpt-5.3-codex medium
What platform is your computer?
Ubuntu 24.04.3 LTS (Noble Numbat), Linux 6.8.0-110-generic, x86_64.
This is a remote SSH environment accessed from VS Code integrated terminal.
What terminal emulator and version are you using (if applicable)?
VS Code integrated terminal over SSH, running tmux 3.6a.
Inside tmux:
TERM=tmux-256color
COLORTERM=truecolor
TERM_PROGRAM=tmux
tmux 3.6a
mouse off
history-limit 100000
mode-keys vi
terminal-overrides[1] *:smcup@:rmcup@
What issue are you seeing?
Codex loses the filled background/pill styling for parts of the TUI when run inside tmux 3.6a. The same Codex session outside tmux in the same VS Code terminal renders the expected colored backgrounds/pills.
This appears similar to the closed issue #19741, but I can still reproduce it with Codex CLI 0.130.0 on Ubuntu + VS Code Remote SSH + tmux 3.6a.
Important detail: tmux itself still renders ANSI/truecolor correctly. For example, this works inside tmux 3.6a:
printf '\033[31mRED\033[0m \033[36mCYAN\033[0m \033[38;2;255;80;80mTRUECOLOR\033[0m\n'
So this does not look like a general tmux truecolor failure. It seems specific to Codex TUI color/background detection under tmux 3.6a.
What steps can reproduce the bug?
- Start from VS Code integrated terminal connected to a remote Ubuntu host over SSH.
- Confirm tmux 3.6a is active:
tmux -V
# tmux 3.6a
- Create or attach a tmux session:
tmux new -s codex_tmux
- Confirm ANSI/truecolor output works inside tmux:
printf '\033[31mRED\033[0m \033[36mCYAN\033[0m \033[38;2;255;80;80mTRUECOLOR\033[0m\n'
- Run Codex inside tmux:
codex
- Compare with running
codexoutside tmux in the same VS Code terminal.
What is the expected behavior?
Codex should render the same TUI background/pill colors inside tmux 3.6a as it does outside tmux, assuming ANSI/truecolor output is working.
What is the actual behavior?
Inside tmux 3.6a, Codex renders without the expected background/pill fill for some TUI elements. Outside tmux, the same UI renders with the expected color/background styling.
Additional information
This was tested after upgrading from tmux 3.4 to tmux 3.6a. The environment was restarted with no old tmux server left running.
The active tmux binary is:
tmux is /usr/local/bin/tmux
tmux is /usr/bin/tmux
tmux is /bin/tmux
tmux 3.6a
The existing closed issue #19741 describes what looks like the same root cause involving OSC 11 / terminal background detection through tmux. If that issue was expected to be fixed, this may be a remaining reproduction on Codex 0.130.0 and Linux/VS Code Remote SSH.
4 Comments
Hey guys, is there any intent on merging this in?
Also hitting this, with a much more thoroughly isolated repro than I initially expected — sharing the full elimination trail in case it narrows down the root cause.
Environment: macOS, Codex CLI 0.142.5, installed via Nix profile, Ghostty (outer terminal), tmux 3.6a.
TERM=xterm-256color,COLORTERM=truecolor, both confirmed correctly set and inherited (checked via bareenv, nosudoinvolved).Symptom: Inside tmux, Codex loses semantic/theme coloring — bold formatting still works, but hex theme colors collapse toward black/near-black or a flat gray instead of rendering as distinct hues. Most noticeable on diff output specifically, which shows no color at all inside tmux where it's fully colored outside tmux, identical command, identical flags, identical binary.
Ruled out, in order tested:
$TERMfrom an old pane/shell — confirmedxterm-256colorin the failing session directly.op runfor MCP secrets) — bypassed entirely, invoked the resolved binary directly with the same flags; bug still reproduces. So it's not injection tooling interfering with stdio/env.sudoenvironment stripping — not applicable to this invocation, but separately confirmed irrelevant.\e[38;2;r;g;bm) render correctly,tput bold/tput setaf/tput colorsall correct (256),ls/eza --color=autoandgrep --color=autoboth auto-detect and colorize correctly (unpiped), and Vim's syntax highlighting (e.g. TOML) renders fully colored. So this is not a tmux/terminfo/general-auto-detection problem — every other tool in the same pane, same session, gets this right.FORCE_COLOR=3,CLICOLOR_FORCE=1, and forcingTERM_PROGRAM=ghostty(since$TERM_PROGRAMreportstmuxinside a tmux session) — none changed the behavior.printf '\e]11;?\e\\') and tmux correctly relays an accurate background-color response, so it's not simply a dead/garbled OSC 11 round-trip either. (Possibly still a timing/race on that query specifically — untested — but the response mechanism itself works.)Net effect: something in Codex's own theme/color-rendering path is making a different (and incorrect) capability decision when it detects it's running inside tmux, despite every generic and terminfo-based capability check in the same pane being correct. Given
TERM_PROGRAM=tmuxis reliably present and distinguishable in this context, that seems like the most likely signal Codex is keying off internally, but I don't have visibility into the actual detection code to confirm.Happy to run further diagnostics (timing captures, testing specific
tui.themeconfig combinations, etc.) if useful.Confirmed: this is still reproducible with Codex CLI 0.144.4.
Environment
@openai/codexvia npm)TERM=tmux-256colorCOLORTERM=truecolorTERM_PROGRAM=tmuxNO_COLORis not setSymptom
Both the composer/input background and completed user-message background pill are missing inside tmux. Other colors, including the truecolor status line, render correctly.
I captured the live pane with escape attributes preserved. User messages had foreground color but no background SGR, and the composer was explicitly rendered with the terminal default background (
49). This is not a generic no-color or 256-color failure.Negative controls
tui.alternate_screen="always": no changeTERM=tmux-256colorandCOLORTERM=truecolorconfirmed in the actual native Codex processtui.themeonly changes syntax highlightingCode-path match
The current 0.144.4 source still has the same fallback:
ChatComposerand user-message history cells both useuser_message_style(), which explains why both backgrounds disappear together. The startup probe still has a fixed 100 ms deadline for the OSC 10/11 color query. The observed result is therefore consistent withdefault_bg() == None, and also with the SSH timing report in #23489.This remains a practical problem for tmux-based remote workflows. A configurable fallback background, an asynchronous/retry probe, or a non-empty fallback for
Nonewould prevent the composer and user-message distinction from disappearing when OSC 10/11 is unavailable or late.FWIW It would be great to have a configuration option to completely disable background colors for the user prompt.
Right now, I have to rely on a custom CLI wrapper that strips OSC10/11 TTY responses just to bypass it, but native support would be much better.