summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorMiguel Solorio <[email protected]>2025-05-13 16:08:12 -0700
committerGitHub <[email protected]>2025-05-13 16:08:12 -0700
commitc4fb1ad04b2b6fe6d6ed582d2754de09a1460cfe (patch)
treed003c3e42e9c0ed9b763583cf61e7a8c58c35fc2 /packages/cli/src
parent4a0f5476c0c4fbca586167c7b858b2db139c2d41 (diff)
Use `Enter` on slash commands to execute (#334)
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
index 072fe074..79062853 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -60,6 +60,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
const base = query.substring(0, slashIndex + 1);
const newValue = base + selectedSuggestion.value;
onChangeAndMoveCursor(newValue);
+ onSubmit(newValue); // Execute the command
} else {
// Handle @ command completion
const atIndex = query.lastIndexOf('@');
@@ -85,7 +86,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
resetCompletion(); // Hide suggestions after selection
},
- [query, suggestions, resetCompletion, onChangeAndMoveCursor],
+ [query, suggestions, resetCompletion, onChangeAndMoveCursor, onSubmit],
);
const inputPreprocessor = useCallback(