Merge pull request #8928 from uinstinct/cli-single-submit

feat: submit slash command in one enter
This commit is contained in:
Dallin Romney 2025-12-05 09:51:37 -08:00 • committed by GitHub
commit ad057ec20e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View file

@ -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

View file

@ -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;
}