mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Add readline-like keybindings to the input prompts. (#354)
New keybindings in the main input prompt (when auto-suggestions are not active):
- `Ctrl+L`: Clears the entire screen.
- `Ctrl+A`: Moves the cursor to the beginning of the current input line.
- `Ctrl+E`: Moves the cursor to the end of the current input line.
- `Ctrl+P`: Navigates to the previous command in the input history.
- `Ctrl+N`: Navigates to the next command in the input history.
In the multiline text editor (e.g., when editing a previous message):
- `Ctrl+K`: Deletes text from the current cursor position to the end of the line ("kill line right").
This commit is contained in:
@@ -180,6 +180,11 @@ export const App = ({
|
||||
[setQuery, setEditorState],
|
||||
);
|
||||
|
||||
const handleClearScreen = useCallback(() => {
|
||||
clearItems();
|
||||
refreshStatic();
|
||||
}, [clearItems, refreshStatic]);
|
||||
|
||||
const completion = useCompletion(
|
||||
query,
|
||||
config.getTargetDir(),
|
||||
@@ -305,6 +310,8 @@ export const App = ({
|
||||
navigateSuggestionUp={completion.navigateUp}
|
||||
navigateSuggestionDown={completion.navigateDown}
|
||||
resetCompletion={completion.resetCompletionState}
|
||||
setEditorState={setEditorState}
|
||||
onClearScreen={handleClearScreen} // Added onClearScreen prop
|
||||
/>
|
||||
{completion.showSuggestions && (
|
||||
<Box>
|
||||
|
||||
Reference in New Issue
Block a user