Repository navigation
fix(cli): prevent Tab key from cycling approval mode when autocomplete is active on Windows - #1736
Merged
Merged
Conversation
…e 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
LaZzyMan
requested review from
DennisYu07,
Mingholy,
gwinthis,
pomelo-nwu and
tanzhenxin
as code owners
February 6, 2026 03:04
Contributor
📋 Review SummaryThis PR addresses a Windows-specific issue where the Tab key would incorrectly cycle approval modes instead of accepting autocomplete suggestions when the autocomplete list is visible. The solution introduces a callback mechanism to track autocomplete visibility and conditionally block Tab key handling in the approval mode cycling logic. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Remove duplicate useEffect that was causing suggestions visibility state to diverge from the actual active completion. The original useEffect at line 760 already correctly tracks activeCompletion.showSuggestions, which dynamically selects the current active completion source (regular, reverse search, or command search). The removed useEffect used OR logic across all three completion sources, which caused hasSuggestionsVisible in AppContainer to flip incorrectly during command-search mode when background completion state changed. This fix ensures Tab key blocking/unblocking happens at the correct times on Windows.
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
…te-conflict-1728 fix(cli): prevent Tab key from cycling approval mode when autocomplete is active on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Fixes #1728 - On Windows, Tab key now correctly accepts autocomplete suggestions instead of cycling approval modes when the autocomplete list is visible.
Dive Deeper
Previously, when users pressed Tab to complete file paths (e.g.,
@path/to/file) on Windows, the Tab key would incorrectly cycle through approval modes instead of accepting the autocomplete suggestion. This was caused by the Windows-specific workaround that maps Tab to Shift+Tab functionality (since Shift+Tab doesn't work reliably in some Windows terminals).The fix introduces a
shouldBlockTabcallback mechanism that checks if autocomplete is currently active. When the autocomplete list is visible, Tab key presses are allowed to pass through to the autocomplete handler instead of being intercepted by the approval mode cycling logic.Key Changes:
shouldBlockTaboptional parameter touseAutoAcceptIndicatorhookonSuggestionsVisibilityChangecallbackInputPrompt→Composer→AppContainer→useAutoAcceptIndicatorReviewer Test Plan
Prerequisites: Windows environment (or temporarily enable the fix on Mac by modifying the platform check)
Test autocomplete blocking:
@to trigger file path autocompleteTest normal Tab behavior:
Test slash command autocomplete:
/to trigger command autocompleteRun automated tests:
npm test -- useAutoAcceptIndicatorAll 15 tests should pass, including 2 new tests for the
shouldBlockTabbehavior.Testing Matrix
Linked issues / bugs
Fixes #1728