mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Adding in a history buffer (#38)
Up and down arrows traverse the command history.
This commit is contained in:
parent
2f5f6baf0f
commit
75ecb4a81f
4 changed files with 164 additions and 18 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue