Adding in a history buffer (#38)

Up and down arrows traverse the command history.
This commit is contained in:
Evan Senter
2025-04-19 14:31:59 +01:00
committed by GitHub
parent 2f5f6baf0f
commit 75ecb4a81f
4 changed files with 164 additions and 18 deletions

View File

@@ -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'}>&gt; </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>