fix(tui): make hotkeys & numpad work again in IDEs while focus is in TUI#27665
Open
Noitidart wants to merge 1 commit into
Open
fix(tui): make hotkeys & numpad work again in IDEs while focus is in TUI#27665Noitidart wants to merge 1 commit into
Noitidart wants to merge 1 commit into
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
7138a65 to
61c4581
Compare
61c4581 to
ab16cd5
Compare
… TUI VS Code's terminal does not support the Kitty keyboard protocol (microsoft/vscode#286809 was closed), so enabling it has no benefit and triggers a shortcut dispatch bug where IDE keybindings like Cmd+Shift+E and Ctrl+Shift+G stop forwarding while the TUI has focus (microsoft/vscode#304806). It also triggers a Chromium regression where numpad keys are reported as "Unidentified" when Kitty protocol is active, causing them to be silently dropped (microsoft/vscode#299374). Detect VS Code's terminal via TERM_PROGRAM=vscode (also set by Cursor and Windsurf) and pass false to useKittyKeyboard to prevent the protocol from being activated. No functionality is lost since VS Code's terminal never supported Kitty to begin with. Fixes anomalyco#27006 Fixes anomalyco#16100
ab16cd5 to
76752ca
Compare
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.
Issue for this PR
Closes #27006
Closes #16100
Type of change
What does this PR do?
When opencode runs in VS Code's integrated terminal (and forks like Cursor/Windsurf), IDE keyboard shortcuts stop forwarding to the IDE while the TUI has focus. This affects shortcuts like Cmd+Shift+E (file explorer), Ctrl+Shift+G (git sidebar), Cmd+Option+K (file reference prefill), and others.
The root issue is that VS Code's terminal does not support the Kitty keyboard protocol — microsoft/vscode#286809 was closed without implementing it. Enabling Kitty has no benefit in VS Code, but it triggers a keybinding dispatch bug (microsoft/vscode#304806) where the shortcut resolves correctly via "soft dispatching" but the event "cannot be dispatched" — the raw keystroke leaks to the terminal where the modifier key gets stripped.
It also triggers a Chromium regression (microsoft/vscode#299374) where numpad keys are reported as
"Unidentified"when Kitty protocol is active, causing them to be silently dropped (#16100).The fix detects VS Code's integrated terminal via
TERM_PROGRAM=vscode(which Cursor and Windsurf also set since they're VS Code forks) and disables the Kitty keyboard protocol for that session by passingfalsetouseKittyKeyboard. No functionality is lost since VS Code's terminal never supported Kitty to begin with. All other terminals retain full Kitty support.How did you verify your code works?
Ran
bun devfrom a Cursor integrated terminal:Typecheck passes: all 14 packages pass
bun turbo typecheck.Screenshots / recordings
N/A — no UI changes, only keyboard input handling.
Checklist