diff options
| author | Evan Senter <[email protected]> | 2025-04-19 14:31:59 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-19 14:31:59 +0100 |
| commit | 75ecb4a81fa76aa00374601b2c0bbe9d657b4aa7 (patch) | |
| tree | 5793e545a45073801a1c817530ff095769e1399c /packages/cli/src/ui/components/InputPrompt.tsx | |
| parent | 2f5f6baf0f4c9c1133b0271fcb3b9e89402b97a1 (diff) | |
Adding in a history buffer (#38)
Up and down arrows traverse the command history.
Diffstat (limited to 'packages/cli/src/ui/components/InputPrompt.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/InputPrompt.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index 3b6b10b1..b5d0b2b5 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -14,12 +14,15 @@ interface InputPromptProps { setQuery: (value: string) => void; onSubmit: (value: string) => void; isActive: boolean; + forceKey?: number; } export const InputPrompt: React.FC<InputPromptProps> = ({ query, setQuery, onSubmit, + isActive, + forceKey, }) => { const model = globalConfig.getModel(); @@ -28,11 +31,12 @@ export const InputPrompt: React.FC<InputPromptProps> = ({ <Text color={'white'}>> </Text> <Box flexGrow={1}> <TextInput + key={forceKey?.toString()} value={query} onChange={setQuery} onSubmit={onSubmit} showCursor={true} - focus={true} + focus={isActive} placeholder={`Ask Gemini (${model})... (try "/init" or "/help")`} /> </Box> |
