diff --git a/codex-rs/tui/src/bottom_pane/help_view.rs b/codex-rs/tui/src/bottom_pane/help_view.rs index 972d6bd859..51efd1f4a8 100644 --- a/codex-rs/tui/src/bottom_pane/help_view.rs +++ b/codex-rs/tui/src/bottom_pane/help_view.rs @@ -157,6 +157,11 @@ impl BottomPaneView for SlashHelpView { } => self.scroll_by(MAX_POPUP_ROWS as isize), KeyEvent { code: KeyCode::Esc, .. + } + | KeyEvent { + code: KeyCode::Char('q'), + modifiers: KeyModifiers::NONE, + .. } => { self.on_ctrl_c(); } diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 17c390ef47..ccfedc0801 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -6035,6 +6035,18 @@ async fn slash_help_esc_dismisses_popup() { assert!(!chat.bottom_pane.has_active_view()); } +#[tokio::test] +async fn slash_help_q_dismisses_popup() { + let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await; + + chat.dispatch_command(SlashCommand::Help); + assert!(chat.bottom_pane.has_active_view()); + + chat.handle_key_event(KeyEvent::from(KeyCode::Char('q'))); + + assert!(!chat.bottom_pane.has_active_view()); +} + #[tokio::test] async fn slash_copy_state_is_preserved_during_running_task() { let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;