From ba17643d500c7a35d4606c99dd521fe51925b341 Mon Sep 17 00:00:00 2001 From: "continue[bot]" Date: Wed, 19 Nov 2025 03:59:25 +0000 Subject: [PATCH 1/2] Fix CLI slash command requiring double Enter press When using slash commands in the CLI, users previously had to press Enter twice - once to select the command and once to submit it. This fix checks if the user typed an exact match for a command and pressed Enter. If so, the command is submitted immediately instead of just being selected. The fix maintains the existing behavior for: - Tab key (autocomplete only, no submission) - Partial matches (autocomplete to full command name) Fixes #8683 Co-authored-by: dallin --- extensions/cli/src/ui/UserInput.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index fb31e4e5c1d..c786025ae10 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -463,7 +463,23 @@ const UserInput: React.FC = ({ if ((key.return && !key.shift) || key.tab) { if (filteredCommands.length > 0) { - selectSlashCommand(filteredCommands[selectedCommandIndex].name); + const selectedCommand = filteredCommands[selectedCommandIndex]; + + // Check if the current input is an exact match (ignoring case) + // and the user pressed Enter (not Tab) + const trimmedInput = inputText.trim(); + const isExactMatch = + trimmedInput.toLowerCase() === + `/${selectedCommand.name}`.toLowerCase(); + + if (key.return && isExactMatch) { + // For exact match with Enter, submit the command immediately + // by falling through to handleEnterKey instead of just selecting + return false; + } + + // Otherwise, just select the command (Tab or non-exact match) + selectSlashCommand(selectedCommand.name); } return true; } From 665dba943985da0eee740e7de31cb46bfeb09fa3 Mon Sep 17 00:00:00 2001 From: "continue[bot]" Date: Wed, 19 Nov 2025 04:06:33 +0000 Subject: [PATCH 2/2] Exclude commands requiring arguments from auto-submit Commands like /title and /init require arguments, so they should not auto-submit when user presses Enter on an exact match. Instead, they should autocomplete and wait for the user to add arguments. This ensures users don't accidentally submit incomplete commands. Co-authored-by: dallin --- extensions/cli/src/ui/UserInput.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index c786025ae10..1d4189cf2ad 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -465,6 +465,9 @@ const UserInput: React.FC = ({ if (filteredCommands.length > 0) { const selectedCommand = filteredCommands[selectedCommandIndex]; + // Commands that require arguments and should not auto-submit + const commandsRequiringArgs = ["title", "init"]; + // Check if the current input is an exact match (ignoring case) // and the user pressed Enter (not Tab) const trimmedInput = inputText.trim(); @@ -472,7 +475,15 @@ const UserInput: React.FC = ({ trimmedInput.toLowerCase() === `/${selectedCommand.name}`.toLowerCase(); - if (key.return && isExactMatch) { + // Only auto-submit if: + // 1. User pressed Enter (not Tab) + // 2. Input is an exact match + // 3. Command doesn't require arguments + if ( + key.return && + isExactMatch && + !commandsRequiringArgs.includes(selectedCommand.name) + ) { // For exact match with Enter, submit the command immediately // by falling through to handleEnterKey instead of just selecting return false;