Skip to content

Do not rely on startup OSC probing for the composer background #23489

@haowang02

Description

@haowang02

What version of Codex CLI is running?

codex-cli 0.131.0

What subscription do you have?

ChatGPT Pro 20x

Which model were you using?

gpt-5.5

What platform is your computer?

Linux 6.8.0-90-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

iTerm2 (ssh)

Codex doctor report

What issue are you seeing?

Codex uses startup OSC 10/11 probing to detect terminal colors for the TUI composer background. This is unreliable over SSH because the response has to round-trip through the local terminal emulator.

Relevant code:

  • Startup probe timeout is 100ms: codex-rs/tui/src/terminal_probe.rs
    pub(crate) const DEFAULT_TIMEOUT: Duration = Duration::from_millis(100);
  • Default colors require both OSC 10 and OSC 11:
    fn parse_default_colors(buffer: &[u8]) -> Option<DefaultColors> {
        let fg = parse_osc_color(buffer, /*slot*/ 10)?;
        let bg = parse_osc_color(buffer, /*slot*/ 11)?;
        Some(DefaultColors { fg, bg })
    }
  • Composer background depends on user_message_style():
    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(),
        }
    }

In my SSH session, OSC 10/11 are supported, but the responses always arrive after 100ms. As a result, the composer background appears locally, but disappears when running Codex over SSH.

Image

Please consider removing this startup probe as a hard dependency for the composer background. Possible alternatives:

  • use a theme/default composer background without probing;
  • probe asynchronously and update later;
  • retry instead of caching failure;
  • allow users to configure the composer background.

Increasing the timeout would help some cases, but the core issue is that fixed startup OSC probing is fragile over SSH.

What steps can reproduce the bug?

  1. Run Codex on the remote machine.
  2. Observe that the composer/input background is missing.

The bug is reproducible when OSC 10/11 are supported but the response arrives after Codex's 100ms startup probe timeout.

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingremote

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions