codex - 💡(How to fix) Fix Detect Warp CLI agent sessions as Warp Terminal

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…

Fix Action

Fix / Workaround

This is intentionally narrower than closed PR #16878. It does not bypass focus handling, force OSC 9, or add a TUI notification workaround. It only teaches the shared terminal-detection crate to recognize Warp from the Warp CLI-agent marker when TERM_PROGRAM is absent.

Minimal patch prepared

RAW_BUFFERClick to expand / collapse

What issue are you seeing?

Codex already has TerminalName::WarpTerminal, and the TUI notification auto-selection already treats that terminal as OSC 9 capable. However, codex-terminal-detection currently recognizes Warp only through TERM_PROGRAM values such as warp or WarpTerminal.

Warp's public docs list OpenAI Codex (CLI) as a supported third-party CLI agent: https://docs.warp.dev/agents/using-agents/third-party-cli-agents. In Warp CLI-agent sessions, WARP_CLI_AGENT_PROTOCOL_VERSION can be present even when TERM_PROGRAM is absent. In that case Codex falls through to the generic TERM fallback, commonly xterm-256color, and records TerminalName::Unknown instead of using the existing Warp path.

This is intentionally narrower than closed PR #16878. It does not bypass focus handling, force OSC 9, or add a TUI notification workaround. It only teaches the shared terminal-detection crate to recognize Warp from the Warp CLI-agent marker when TERM_PROGRAM is absent.

Minimal patch prepared

Branch: https://github.com/mitre88/codex/tree/fix/warp-cli-agent-terminal-detection Compare: https://github.com/openai/codex/compare/main...mitre88:codex:fix/warp-cli-agent-terminal-detection

Scope:

  • codex-rs/terminal-detection/src/lib.rs: detect non-empty WARP_CLI_AGENT_PROTOCOL_VERSION as TerminalName::WarpTerminal after the TERM_PROGRAM check.
  • codex-rs/terminal-detection/src/terminal_tests.rs: add a regression test for missing TERM_PROGRAM plus TERM=xterm-256color.

Validation

  • cargo fmt --package codex-terminal-detection --check passed. Rustfmt emitted the existing warning about unstable imports_granularity on stable.
  • cargo test -p codex-terminal-detection detects_warp -- --nocapture passed: 2 passed.
  • cargo test -p codex-terminal-detection passed: 21 passed.
  • git diff --check passed.

Happy to open the PR from that branch if maintainers want this direction.

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 Detect Warp CLI agent sessions as Warp Terminal