From fbdc8d5ab3f76aef32af6a8f516d97771c56a7ac Mon Sep 17 00:00:00 2001
From: Sijie Wang <3463757+sijieamoy@users.noreply.github.com>
Date: Fri, 25 Jul 2025 15:36:42 -0700
Subject: Vim mode (#3936)

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

(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 8d296dc4..17b7694e 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -39,6 +39,7 @@ export interface InputPromptProps {
   suggestionsWidth: number;
   shellModeActive: boolean;
   setShellModeActive: (value: boolean) => void;
+  vimHandleInput?: (key: Key) => boolean;
 }
 
 export const InputPrompt: React.FC<InputPromptProps> = ({
@@ -55,6 +56,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
   suggestionsWidth,
   shellModeActive,
   setShellModeActive,
+  vimHandleInput,
 }) => {
   const [justNavigatedHistory, setJustNavigatedHistory] = useState(false);
 
@@ -169,6 +171,10 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
         return;
       }
 
+      if (vimHandleInput && vimHandleInput(key)) {
+        return;
+      }
+
       if (
         key.sequence === '!' &&
         buffer.text === '' &&
@@ -347,6 +353,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
       shellHistory,
       handleClipboardImage,
       resetCompletionState,
+      vimHandleInput,
     ],
   );
 
-- 
cgit v1.2.3

