codex - 💡(How to fix) Fix Do not rely on startup OSC probing for the composer background [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#23489Fetched 2026-05-20 03:48:58
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1unlabeled ×1

Root Cause

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.

Code Example



---

pub(crate) const DEFAULT_TIMEOUT: Duration = Duration::from_millis(100);

---

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 })
  }

---

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(),
      }
  }
RAW_BUFFERClick to expand / collapse

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.

<img width="596" height="250" alt="Image" src="https://github.com/user-attachments/assets/5e93503d-90f6-4ec3-95c7-fb1f3339007f" />

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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Do not rely on startup OSC probing for the composer background [1 comments, 2 participants]