Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions extensions/cli/spec/shell-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Interaction with other input helpers
- "/" slash command UI is disabled.
- When in slash command mode (input starts with /):
- "@" file search suggestions are disabled.
- Enter submits the highlighted slash command directly (except /title, which requires Tab to select first).
- Tab selects the highlighted command without submitting.

Submission behavior

Expand Down
23 changes: 22 additions & 1 deletion extensions/cli/src/ui/UserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,28 @@ const UserInput: React.FC<UserInputProps> = ({

if ((key.return && !key.shift) || key.tab) {
if (filteredCommands.length > 0) {
selectSlashCommand(filteredCommands[selectedCommandIndex].name);
const commandName = filteredCommands[selectedCommandIndex].name;
if (key.return && commandName !== "title") {
// select and submit the command
const commandText = "/" + commandName;
inputHistory.addEntry(commandText);

// queue up when responding/generating
if (!isRemoteMode && (isWaitingForResponse || isCompacting)) {
void messageQueue.enqueueMessage(commandText);
} else {
onSubmit(commandText);
}

// reset after submitting command
textBuffer.clear();
setInputText("");
setCursorPosition(0);
setShowSlashCommands(false);
setShowBashMode(false);
} else {
selectSlashCommand(commandName);
}
}
return true;
}
Expand Down
Loading