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 = ({ 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 = ({ resetCompletion(); // Hide suggestions after selection }, - [query, suggestions, resetCompletion, onChangeAndMoveCursor], + [query, suggestions, resetCompletion, onChangeAndMoveCursor, onSubmit], ); const inputPreprocessor = useCallback(