From ecc66f4f52d45f9cf5530ee378281aaf6c2690b0 Mon Sep 17 00:00:00 2001 From: natea-oai Date: Wed, 28 Jan 2026 17:52:27 -0800 Subject: [PATCH] removing quit from dropdown menu, but not autocomplete [cli] (#10128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently we have both `\quit` and `\exit` which do the same thing. This removes `\quit` from the slash command menu but allows it to still be an autocomplete option & working for those used to that command. `/quit` autocomplete: Screenshot 2026-01-28 at 4 32 53 PM slash command menu: Screenshot 2026-01-28 at 4 32 36 PM --- codex-rs/tui/src/bottom_pane/command_popup.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/codex-rs/tui/src/bottom_pane/command_popup.rs b/codex-rs/tui/src/bottom_pane/command_popup.rs index e879e880c..c1cdd5374 100644 --- a/codex-rs/tui/src/bottom_pane/command_popup.rs +++ b/codex-rs/tui/src/bottom_pane/command_popup.rs @@ -120,6 +120,10 @@ impl CommandPopup { if filter.is_empty() { // Built-ins first, in presentation order. for (_, cmd) in self.builtins.iter() { + // Skipping quit as it's a duplicate of exit. + if *cmd == SlashCommand::Quit { + continue; + } out.push((CommandItem::Builtin(*cmd), None)); } // Then prompts, already sorted by name. @@ -437,6 +441,18 @@ mod tests { ); } + #[test] + fn quit_hidden_in_empty_filter_but_shown_for_prefix() { + let mut popup = CommandPopup::new(Vec::new(), CommandPopupFlags::default()); + popup.on_composer_text_change("/".to_string()); + let items = popup.filtered_items(); + assert!(!items.contains(&CommandItem::Builtin(SlashCommand::Quit))); + + popup.on_composer_text_change("/qu".to_string()); + let items = popup.filtered_items(); + assert!(items.contains(&CommandItem::Builtin(SlashCommand::Quit))); + } + #[test] fn collab_command_hidden_when_collaboration_modes_disabled() { let mut popup = CommandPopup::new(Vec::new(), CommandPopupFlags::default());