[codex] Add tmux-aware OSC 9 notifications (#17836)

## Summary
- wrap OSC 9 notifications in tmux's DCS passthrough so terminal
notifications make it through tmux
- use codex-terminal-detection for OSC 9 auto-selection so tmux sessions
inherit the underlying client terminal support
- add focused notification backend tests for plain OSC 9 and
tmux-wrapped output

## Stack
- base PR: #18479
- review order: #18479, then this PR

## Why
Tmux does not forward OSC 9 notifications directly; the sequence has to
be wrapped in tmux's DCS passthrough envelope. Codex also had local
notification heuristics that could miss supported terminals when running
under tmux, even though codex-terminal-detection already knows how to
attribute tmux sessions to the client terminal.

## Validation
- `just fmt`
- `cargo test -p codex-tui` *(currently blocked by an unrelated existing
compile error in `app-server/src/message_processor.rs:754` referencing
`connection_id` out of scope; not caused by this change)*

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Casey Chow
2026-04-21 13:10:36 -04:00
committed by GitHub
parent 3a9df58d06
commit 41652665f5
4 changed files with 192 additions and 85 deletions

View File

@@ -456,6 +456,44 @@ fn detects_wezterm() {
"WezTerm",
"wezterm_empty_user_agent"
);
let env = FakeEnvironment::new().with_var("TERM", "wezterm");
let terminal = detect_terminal_info_from_env(&env);
assert_eq!(
terminal,
terminal_info(
TerminalName::WezTerm,
/*term_program*/ None,
/*version*/ None,
Some("wezterm"),
/*multiplexer*/ None
),
"wezterm_term_info"
);
assert_eq!(
terminal.user_agent_token(),
"wezterm",
"wezterm_term_user_agent"
);
let env = FakeEnvironment::new().with_var("TERM", "wezterm-mux");
let terminal = detect_terminal_info_from_env(&env);
assert_eq!(
terminal,
terminal_info(
TerminalName::WezTerm,
/*term_program*/ None,
/*version*/ None,
Some("wezterm-mux"),
/*multiplexer*/ None
),
"wezterm_mux_term_info"
);
assert_eq!(
terminal.user_agent_token(),
"wezterm-mux",
"wezterm_mux_term_user_agent"
);
}
#[test]