mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 11:41:04 +00:00
fix(cli): prevent Tab key from cycling approval mode when autocomplete is active on Windows
Fixes #1728 When using @ to reference files/folders on Windows and pressing Tab for path completion, the Tab key was incorrectly triggering approval mode cycling instead of accepting the autocomplete suggestion. This happened because Windows maps Tab to Shift+Tab functionality (due to Shift+Tab not working in some terminals), but this mapping didn't account for active autocomplete lists where Tab should be used for selection. Changes: - Add shouldBlockTab callback to useAutoAcceptIndicator hook to check if autocomplete is active - Track autocomplete visibility state in AppContainer via hasSuggestionsVisible - Add onSuggestionsVisibilityChange to UIActions interface - Update InputPrompt to notify parent when suggestions visibility changes - Update Composer to propagate suggestions visibility to AppContainer - Add tests to verify Tab key behavior with and without autocomplete
This commit is contained in:
parent
d90b642564
commit
9a6aafa721
6 changed files with 114 additions and 3 deletions
|
|
@ -37,9 +37,14 @@ export const Composer = () => {
|
|||
|
||||
// State for suggestions visibility
|
||||
const [showSuggestions, setShowSuggestions] = useState(false);
|
||||
const handleSuggestionsVisibilityChange = useCallback((visible: boolean) => {
|
||||
setShowSuggestions(visible);
|
||||
}, []);
|
||||
const handleSuggestionsVisibilityChange = useCallback(
|
||||
(visible: boolean) => {
|
||||
setShowSuggestions(visible);
|
||||
// Also notify AppContainer for Tab key handling
|
||||
uiActions.onSuggestionsVisibilityChange(visible);
|
||||
},
|
||||
[uiActions],
|
||||
);
|
||||
|
||||
return (
|
||||
<Box flexDirection="column" marginTop={1}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue