Skip to content

Codex 0.130.0 still loses background/pill colors inside tmux 3.6a #22761

Closed

Description

@saigonbaddielover

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?

  1. Start from VS Code integrated terminal connected to a remote Ubuntu host over SSH.
  2. Confirm tmux 3.6a is active:
tmux -V
# tmux 3.6a
  1. Create or attach a tmux session:
tmux new -s codex_tmux
  1. 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'
  1. Run Codex inside tmux:
codex
  1. Compare with running codex outside 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.

Activity

  1. added
    bug
    TUI
    on May 15, 2026
  2. harivansh-afk commented on Jun 23, 2026

    @harivansh-afk

    Hey guys, is there any intent on merging this in?

  3. Gipetto commented on Jul 9, 2026

    @Gipetto

    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 bare env, no sudo involved).

    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:

    • Stale $TERM from an old pane/shell — confirmed xterm-256color in the failing session directly.
    • Any wrapper/secrets-injection tooling (I normally run Codex through a script that pipes through op run for 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.
    • sudo environment stripping — not applicable to this invocation, but separately confirmed irrelevant.
    • Generic terminal color-capability detection — confirmed fully healthy in the exact same tmux pane: raw ANSI truecolor escapes (\e[38;2;r;g;bm) render correctly, tput bold/tput setaf/tput colors all correct (256), ls/eza --color=auto and grep --color=auto both 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.
    • Manual override env vars — tried FORCE_COLOR=3, CLICOLOR_FORCE=1, and forcing TERM_PROGRAM=ghostty (since $TERM_PROGRAM reports tmux inside a tmux session) — none changed the behavior.
    • Earlier suspected OSC 11 background-query failure through tmux — tested directly (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=tmux is 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.theme config combinations, etc.) if useful.

  4. etinpres commented on Jul 16, 2026

    @etinpres

    Confirmed: this is still reproducible with Codex CLI 0.144.4.

    Environment

    • macOS 26.5.2, arm64
    • Codex CLI 0.144.4 (@openai/codex via npm)
    • tmux 3.6a
    • Codex running inside tmux over SSH
    • Actual Codex process environment:
      • TERM=tmux-256color
      • COLORTERM=truecolor
      • TERM_PROGRAM=tmux
      • NO_COLOR is not set

    Symptom

    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

    • One-off tui.alternate_screen="always": no change
    • TERM=tmux-256color and COLORTERM=truecolor confirmed in the actual native Codex process
    • Codex 0.143.0: same behavior
    • Current config has no semantic/composer background override; tui.theme only changes syntax highlighting

    Code-path match

    The current 0.144.4 source still has the same fallback:

    pub fn user_message_style_for(terminal_bg: Option<(u8, u8, u8)>) -> Style {
        match terminal_bg {
            Some(bg) => Style::default().bg(user_message_bg(bg)),
            None => Style::default(),
        }
    }

    ChatComposer and user-message history cells both use user_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 with default_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 None would prevent the composer and user-message distinction from disappearing when OSC 10/11 is unavailable or late.

  5. oandrew commented on Jul 17, 2026

    @oandrew

    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.

  6. leftspin commented on Oct 29, 2026

    @leftspin

    I have a related opposite failure mode in a remote tmux workflow. After switching the outer Ghostty terminal to a light palette, a newly launched Codex reached through Eternal Terminal and tmux 3.4 showed black text on a black composer. Relaunching Codex did not clear it. The reports above describe a missing composer fill; this observation had an apparently wrong dark fill. I do not have the affected Codex binary version or captured OSC replies from that session, so I cannot claim the two observations have the same cause.

    The Codex rust-v0.164.0 source provides a plausible styling path: terminal_palette.rs caches the startup OSC 10/11 colors (including unavailable results), and style.rs::user_message_style_for derives an explicit background only from the reported background. The composer text retains the terminal-default foreground. The normal chat_composer.rs and inline_input.rs::render_inline_input both use that derived fill. Submitted prompts use the separate history_prompt_style() background in style.rs. I also found these background-only paths at inspected upstream commit 09db085f; that is a source revision, not the version that ran in the affected session.

    At that commit, when no OSC 11 reply is available, history_prompt_style() paints a fixed Color::DarkGray background (the rust-v0.164.0 source leaves submitted prompts unstyled in that case), which can give poor contrast under a light client's dark default text. A stale dark OSC 11 reply paired with a light client's dark default foreground can therefore produce unreadable text. This is a source-based explanation, not a confirmed trace of the session.

    In a separate synthetic upstream tmux 3.4 check with controlled terminal clients, the pane kept returning the old dark OSC 10/11 pair just after a dark-to-light switch, then refreshed after a delayed resize or reattach. With two differently themed clients, the pane reply followed the first attached client in either attach order. This does not verify Ghostty, Eternal Terminal, the affected tmux package, or a Codex render. It illustrates the shared-pane limit: a pane has one output stream, so a single OSC-derived shaded background cannot be correct for two viewers with different palettes at once.

    Would an explicit terminal-default foreground and background reset pair be an appropriate readability option for the normal composer, inline input, and submitted prompts (history_prompt_style())? That would remove their shaded fill but let each viewer use its own terminal default text/background pair, regardless of a stale, missing, or first-client-only OSC reply. It assumes each client's terminal defaults are readable and no tmux style override substitutes a different pair. This would address the two-client case that palette refresh alone cannot; #45163 covers refresh for a long-running session after a live theme switch.

  7. r266-tech commented on Nov 21, 2026

    @r266-tech

    I reproduced the missing composer fill in Codex CLI 0.171.0 (Linux arm64). I kept tmux 3.8, TERM=tmux-256color, COLORTERM=truecolor, the client's RGB feature, and allow-passthrough=off fixed. I typed a marker into the composer without submitting it and read the marked cells from tmux capture-pane -p -e.

    Startup replies Composer background
    OSC 10 and OSC 11 RGB #313131 (48;2;49;49;49)
    OSC 10 only Terminal default
    OSC 11 only Terminal default
    Neither Terminal default

    A direct PTY gave the same four results. All runs still emitted 24-bit color elsewhere. In particular, supplying the background reply alone leaves the composer on the fallback. The Unix parser requires both OSC replies and the composer styles from default_bg(). The reported VS Code/SSH session's replies remain unmeasured. Unix palette parser · Composer style · Related picker experiment

    AI-assisted reproduction.

  8. etraut-openai commented on Nov 22, 2026

    @etraut-openai
    Contributor

    Thanks for the bug report. This will be addressed in an upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions