mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Adding in a history buffer (#38)
Up and down arrows traverse the command history.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user