diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index d87076e002..0af7e6617f 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -6407,7 +6407,13 @@ mod tests { .draw(|f| composer.render(f.area(), f.buffer_mut())) .unwrap_or_else(|e| panic!("Failed to draw composer: {e}")); - insta::assert_snapshot!("slash_popup_root", terminal.backend()); + if cfg!(target_os = "windows") { + insta::with_settings!({ snapshot_suffix => "windows" }, { + insta::assert_snapshot!("slash_popup_root", terminal.backend()); + }); + } else { + insta::assert_snapshot!("slash_popup_root", terminal.backend()); + } } #[test] diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__slash_popup_root@windows.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__slash_popup_root@windows.snap new file mode 100644 index 0000000000..2eded5bf4d --- /dev/null +++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__slash_popup_root@windows.snap @@ -0,0 +1,12 @@ +--- +source: tui/src/bottom_pane/chat_composer.rs +expression: terminal.backend() +--- +" " +"› / " +" " +" /help show slash command help " +" /model choose what model and reasoning " +" effort to use " +" /permissions choose what Codex is allowed to do " +" /sandbox-add-read-dir let sandbox read a directory: / " diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output@windows.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output@windows.snap new file mode 100644 index 0000000000..abc24b16f5 --- /dev/null +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_output@windows.snap @@ -0,0 +1,248 @@ +--- +source: tui/src/chatwidget/tests.rs +expression: popup +--- + Slash Commands + + Type / to open the command popup. For commands with both a picker and an arg form, bare /command + opens the picker and /command ... runs directly. + Args use shell-style quoting; quote values with spaces. + + /help + show slash command help + Usage: + /help + + /model + choose what model and reasoning effort to use + Usage: + /model + /model [default|none|minimal|low|medium|high|xhigh] [plan-only|all-modes] + + /fast + toggle Fast mode to enable fastest inference at 2X plan usage + Usage: + /fast + /fast + + /approvals + choose what Codex is allowed to do + Usage: + /approvals + /approvals [--confirm-full-access] [--remember-full-access] + [--confirm-world-writable] [--remember-world-writable] [--enable-windows- + sandbox=elevated|legacy] + + /permissions + choose what Codex is allowed to do + Usage: + /permissions + /permissions [--confirm-full-access] [--remember-full-access] + [--confirm-world-writable] [--remember-world-writable] [--enable-windows- + sandbox=elevated|legacy] + + /setup-default-sandbox + set up elevated agent sandbox + Usage: + /setup-default-sandbox + + /sandbox-add-read-dir + let sandbox read a directory: /sandbox-add-read-dir + Usage: + /sandbox-add-read-dir + + /experimental + toggle experimental features + Usage: + /experimental + /experimental =on|off ... + + /skills + use skills to improve how Codex performs specific tasks + Usage: + /skills + /skills + + /review + review my current changes and find issues + Usage: + /review + /review uncommitted + /review branch + /review commit [title] + /review + + /rename + rename the current thread + Usage: + /rename + /rename + + /new + start a new chat during a conversation + Usage: + /new + + /resume + resume a saved chat + Usage: + /resume + /resume + + /fork + fork the current chat + Usage: + /fork + + /init + create an AGENTS.md file with instructions for Codex + Usage: + /init + + /compact + summarize conversation to prevent hitting the context limit + Usage: + /compact + + /plan + switch to Plan mode + Usage: + /plan + /plan + + /collab + change collaboration mode (experimental) + Usage: + /collab + /collab + + /agent + switch the active agent thread + Usage: + /agent + /agent + + /diff + show git diff (including untracked files) + Usage: + /diff + + /copy + copy the latest Codex output to your clipboard + Usage: + /copy + + /mention + mention a file + Usage: + /mention + + /status + show current session configuration and token usage + Usage: + /status + + /debug-config + show config layers and requirement sources for debugging + Usage: + /debug-config + + /statusline + configure which items appear in the status line + Usage: + /statusline + /statusline ... + /statusline none + + /theme + choose a syntax highlighting theme + Usage: + /theme + /theme + + /mcp + list configured MCP tools + Usage: + /mcp + + /apps + manage apps + Usage: + /apps + + /logout + log out of Codex + Usage: + /logout + + /quit + exit Codex + Usage: + /quit + + /exit + exit Codex + Usage: + /exit + + /feedback + send logs to maintainers + Usage: + /feedback + /feedback + + /rollout + print the rollout file path + Usage: + /rollout + + /ps + list background terminals + Usage: + /ps + + /clean + stop all background terminals + Usage: + /clean + + /clear + clear the terminal and start a new chat + Usage: + /clear + + /personality + choose a communication style for Codex + Usage: + /personality + /personality + + /realtime + toggle realtime voice mode (experimental) + Usage: + /realtime + + /settings + configure realtime microphone/speaker + Usage: + /settings + /settings [default|] + + /test-approval + test approval request + Usage: + /test-approval + + /multi-agents + switch the active agent thread + Usage: + /multi-agents + /multi-agents + + /debug-m-drop + DO NOT USE + Usage: + /debug-m-drop + + + ↑/↓ scroll | [ctrl + p / ctrl + n] page | / search | esc close 1-237/244 diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output@windows.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output@windows.snap new file mode 100644 index 0000000000..0e0fa91b7c --- /dev/null +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_help_search_output@windows.snap @@ -0,0 +1,248 @@ +--- +source: tui/src/chatwidget/tests.rs +expression: searching +--- + Slash Commands + + Type / to open the command popup. For commands with both a picker and an arg form, bare /command + opens the picker and /command ... runs directly. + Args use shell-style quoting; quote values with spaces. + + /help + show slash command help + Usage: + /help + + /model + choose what model and reasoning effort to use + Usage: + /model + /model [default|none|minimal|low|medium|high|xhigh] [plan-only|all-modes] + + /fast + toggle Fast mode to enable fastest inference at 2X plan usage + Usage: + /fast + /fast + + /approvals + choose what Codex is allowed to do + Usage: + /approvals + /approvals [--confirm-full-access] [--remember-full-access] + [--confirm-world-writable] [--remember-world-writable] [--enable-windows- + sandbox=elevated|legacy] + + /permissions + choose what Codex is allowed to do + Usage: + /permissions + /permissions [--confirm-full-access] [--remember-full-access] + [--confirm-world-writable] [--remember-world-writable] [--enable-windows- + sandbox=elevated|legacy] + + /setup-default-sandbox + set up elevated agent sandbox + Usage: + /setup-default-sandbox + + /sandbox-add-read-dir + let sandbox read a directory: /sandbox-add-read-dir + Usage: + /sandbox-add-read-dir + + /experimental + toggle experimental features + Usage: + /experimental + /experimental =on|off ... + + /skills + use skills to improve how Codex performs specific tasks + Usage: + /skills + /skills + + /review + review my current changes and find issues + Usage: + /review + /review uncommitted + /review branch + /review commit [title] + /review + + /rename + rename the current thread + Usage: + /rename + /rename + + /new + start a new chat during a conversation + Usage: + /new + + /resume + resume a saved chat + Usage: + /resume + /resume + + /fork + fork the current chat + Usage: + /fork + + /init + create an AGENTS.md file with instructions for Codex + Usage: + /init + + /compact + summarize conversation to prevent hitting the context limit + Usage: + /compact + + /plan + switch to Plan mode + Usage: + /plan + /plan + + /collab + change collaboration mode (experimental) + Usage: + /collab + /collab + + /agent + switch the active agent thread + Usage: + /agent + /agent + + /diff + show git diff (including untracked files) + Usage: + /diff + + /copy + copy the latest Codex output to your clipboard + Usage: + /copy + + /mention + mention a file + Usage: + /mention + + /status + show current session configuration and token usage + Usage: + /status + + /debug-config + show config layers and requirement sources for debugging + Usage: + /debug-config + + /statusline + configure which items appear in the status line + Usage: + /statusline + /statusline ... + /statusline none + + /theme + choose a syntax highlighting theme + Usage: + /theme + /theme + + /mcp + list configured MCP tools + Usage: + /mcp + + /apps + manage apps + Usage: + /apps + + /logout + log out of Codex + Usage: + /logout + + /quit + exit Codex + Usage: + /quit + + /exit + exit Codex + Usage: + /exit + + /feedback + send logs to maintainers + Usage: + /feedback + /feedback + + /rollout + print the rollout file path + Usage: + /rollout + + /ps + list background terminals + Usage: + /ps + + /clean + stop all background terminals + Usage: + /clean + + /clear + clear the terminal and start a new chat + Usage: + /clear + + /personality + choose a communication style for Codex + Usage: + /personality + /personality + + /realtime + toggle realtime voice mode (experimental) + Usage: + /realtime + + /settings + configure realtime microphone/speaker + Usage: + /settings + /settings [default|] + + /test-approval + test approval request + Usage: + /test-approval + + /multi-agents + switch the active agent thread + Usage: + /multi-agents + /multi-agents + + /debug-m-drop + DO NOT USE + Usage: + /debug-m-drop + + + Search: /maintainers | enter apply | esc cancel 1 match | 1-237/244 diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 8e41eac6e2..b1ac4ff02f 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -6008,7 +6008,13 @@ async fn slash_help_opens_reference_popup() { assert!(chat.bottom_pane.has_active_view()); let popup = render_bottom_popup(&chat, 100); - assert_snapshot!("slash_help_output", popup); + if cfg!(target_os = "windows") { + insta::with_settings!({ snapshot_suffix => "windows" }, { + assert_snapshot!("slash_help_output", popup); + }); + } else { + assert_snapshot!("slash_help_output", popup); + } assert!(popup.contains("/help")); assert!(popup.contains("/model ")); @@ -6035,7 +6041,13 @@ async fn slash_help_search_jumps_to_lower_match() { chat.handle_key_event(KeyEvent::from(KeyCode::Char(ch))); } let searching = render_bottom_popup(&chat, 100); - assert_snapshot!("slash_help_search_output", searching); + if cfg!(target_os = "windows") { + insta::with_settings!({ snapshot_suffix => "windows" }, { + assert_snapshot!("slash_help_search_output", searching); + }); + } else { + assert_snapshot!("slash_help_search_output", searching); + } assert!(searching.contains("Search: /maintainers")); assert!(searching.contains("1 match"));