From 97a472f2fbccb50379bee43cade84f4f122c7fca Mon Sep 17 00:00:00 2001
From: Sambhav Khanna <125531539+sambhavKhanna@users.noreply.github.com>
Date: Mon, 7 Jul 2025 15:43:27 -0400
Subject: fix(cli): Prevent Tab from auto-executing incomplete slash commands
 (#2919)

Co-authored-by: matt korwel <matt.korwel@gmail.com>
---
 packages/cli/src/ui/components/InputPrompt.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(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 469a4ec5..763d4e7e 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -132,8 +132,11 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
           }
         } else {
           const newValue = base + suggestion;
-          buffer.setText(newValue);
-          handleSubmitAndClear(newValue);
+          if (newValue === query) {
+            handleSubmitAndClear(newValue);
+          } else {
+            buffer.setText(newValue);
+          }
         }
       } else {
         const atIndex = query.lastIndexOf('@');
-- 
cgit v1.2.3

