Skip to content

fix(tui): make hotkeys & numpad work again in IDEs while focus is in TUI#27665

Open
Noitidart wants to merge 1 commit into
anomalyco:devfrom
Noitidart:27006-fix-ide-hotkeys
Open

fix(tui): make hotkeys & numpad work again in IDEs while focus is in TUI#27665
Noitidart wants to merge 1 commit into
anomalyco:devfrom
Noitidart:27006-fix-ide-hotkeys

Conversation

@Noitidart
Copy link
Copy Markdown

@Noitidart Noitidart commented May 15, 2026

Issue for this PR

Closes #27006
Closes #16100

Type of change

  • Bug fix

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 passing false to useKittyKeyboard. 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 dev from a Cursor integrated terminal:

  • Cmd+Shift+E opens file explorer sidebar ✓
  • Ctrl+Shift+G opens git sidebar ✓
  • Cmd+Option+K inserts file reference ✓
  • All opencode TUI keybindings still work (Tab, /, arrows, etc.) ✓

Typecheck passes: all 14 packages pass bun turbo typecheck.

Screenshots / recordings

N/A — no UI changes, only keyboard input handling.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 15, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Noitidart Noitidart force-pushed the 27006-fix-ide-hotkeys branch 4 times, most recently from 7138a65 to 61c4581 Compare May 15, 2026 05:21
@Noitidart Noitidart changed the title fix(tui): disable Kitty keyboard protocol in VS Code integrated terminal fix(tui): make IDE hotkeys work again while focus is in TUI May 15, 2026
@Noitidart Noitidart force-pushed the 27006-fix-ide-hotkeys branch from 61c4581 to ab16cd5 Compare May 15, 2026 05:29
@Noitidart Noitidart changed the title fix(tui): make IDE hotkeys work again while focus is in TUI fix(tui): make hotkeys & numpad work again in IDEs while focus is in TUI May 15, 2026
… 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
@Noitidart Noitidart force-pushed the 27006-fix-ide-hotkeys branch from ab16cd5 to 76752ca Compare May 15, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard shortcuts not forwarding to IDE from opencode terminal Numpad keys not working when running inside VS Code 1.110 integrated terminal

1 participant