Detect Warp CLI agent sessions as Warp Terminal

Resolved 💬 1 comment Opened May 8, 2026 by mitre88 Closed Jul 1, 2026

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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗