Skip to content
Merged
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
17 changes: 16 additions & 1 deletion extensions/cli/src/ui/UserInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,22 @@ 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);
onSubmit(commandText);

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