Detect Warp CLI agent sessions as Warp Terminal
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-emptyWARP_CLI_AGENT_PROTOCOL_VERSIONasTerminalName::WarpTerminalafter theTERM_PROGRAMcheck.codex-rs/terminal-detection/src/terminal_tests.rs: add a regression test for missingTERM_PROGRAMplusTERM=xterm-256color.
Validation
cargo fmt --package codex-terminal-detection --checkpassed. Rustfmt emitted the existing warning about unstableimports_granularityon stable.cargo test -p codex-terminal-detection detects_warp -- --nocapturepassed: 2 passed.cargo test -p codex-terminal-detectionpassed: 21 passed.git diff --checkpassed.
Happy to open the PR from that branch if maintainers want this direction.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗