From e9e2f5514465d596032eed41572f13db3268a81b Mon Sep 17 00:00:00 2001 From: Tommaso Sciortino Date: Wed, 23 Jul 2025 15:49:09 -0700 Subject: Fix InputPrompt.test.tsx to be windows compatible (#4736) --- packages/cli/src/ui/hooks/useShellHistory.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/cli/src/ui/hooks/useShellHistory.ts') diff --git a/packages/cli/src/ui/hooks/useShellHistory.ts b/packages/cli/src/ui/hooks/useShellHistory.ts index 90248cc0..61c7207c 100644 --- a/packages/cli/src/ui/hooks/useShellHistory.ts +++ b/packages/cli/src/ui/hooks/useShellHistory.ts @@ -12,6 +12,13 @@ import { isNodeError, getProjectTempDir } from '@google/gemini-cli-core'; const HISTORY_FILE = 'shell_history'; const MAX_HISTORY_LENGTH = 100; +export interface UseShellHistoryReturn { + addCommandToHistory: (command: string) => void; + getPreviousCommand: () => string | null; + getNextCommand: () => string | null; + resetHistoryPosition: () => void; +} + async function getHistoryFilePath(projectRoot: string): Promise { const historyDir = getProjectTempDir(projectRoot); return path.join(historyDir, HISTORY_FILE); @@ -42,7 +49,7 @@ async function writeHistoryFile( } } -export function useShellHistory(projectRoot: string) { +export function useShellHistory(projectRoot: string): UseShellHistoryReturn { const [history, setHistory] = useState([]); const [historyIndex, setHistoryIndex] = useState(-1); const [historyFilePath, setHistoryFilePath] = useState(null); -- cgit v1.2.3