Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion extensions/cli/src/ui/UserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,23 @@ const UserInput: React.FC<UserInputProps> = ({

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;
}
Expand Down
Loading