From c4fb1ad04b2b6fe6d6ed582d2754de09a1460cfe Mon Sep 17 00:00:00 2001
From: Miguel Solorio <miguel.solorio07@gmail.com>
Date: Tue, 13 May 2025 16:08:12 -0700
Subject: Use `Enter` on slash commands to execute (#334)

---
 packages/cli/src/ui/components/InputPrompt.tsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'packages/cli/src/ui/components/InputPrompt.tsx')

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(
-- 
cgit v1.2.3

