[BUG] VSCode extension: Cmd+Option+Right/Left fires nextEditor twice when Claude Code session tab is in the editor cycle (macOS)

Resolved 💬 4 comments Opened May 22, 2026 by Leecarry16 Closed May 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When a Claude Code session is opened as a VSCode editor tab (via Cmd+Shift+Esc / "Open in New Tab"), pressing Cmd+Option+Right (default macOS shortcut for "View: Open Next Editor") fires the underlying workbench.action.nextEditor command twice in ~8 ms, advancing two tabs at a time instead of one. The same applies to Cmd+Option+Left / workbench.action.previousEditor.

The double-fire happens only when the Claude Code session tab is part of the tab cycle being traversed. Navigating purely between regular editor tabs (e.g., several .py files, no Claude Code tab present) works correctly — one tab per keypress.

What Should Happen?

A single press of Cmd+Option+Right (or Cmd+Option+Left) should advance the active editor by exactly one tab in the current editor group, regardless of whether a Claude Code session tab is one of the tabs.

The Developer Troubleshooting log should show exactly one Invoking command workbench.action.nextEditor line per keypress.

Error Messages/Logs

Enabled via Command Palette → "Developer: Toggle Keyboard Shortcuts Troubleshooting". One single press of Cmd+Option+Right produces TWO dispatches:

2026-05-22 14:58:19.813 [KeybindingService]: / Received  keydown event - modifiers: [alt,meta], code: ArrowRight, keyCode: 39, key: ArrowRight
2026-05-22 14:58:19.813 [KeybindingService]: | Converted keydown event - modifiers: [alt,meta], code: ArrowRight, keyCode: 17 ('RightArrow')
2026-05-22 14:58:19.814 [KeybindingService]: | Resolving alt+meta+[ArrowRight]
2026-05-22 14:58:19.814 [KeybindingService]: \ From 3 keybinding entries, matched workbench.action.nextEditor, when: no when condition, source: built-in.
2026-05-22 14:58:19.814 [KeybindingService]: + Invoking command workbench.action.nextEditor.       ← first fire (keydown)
2026-05-22 14:58:19.821 [KeybindingService]: / Dispatching keybinding triggered via menu entry accelerator - alt+cmd+right
2026-05-22 14:58:19.822 [KeybindingService]: | Resolving alt+meta+[ArrowRight]
2026-05-22 14:58:19.822 [KeybindingService]: \ From 3 keybinding entries, matched workbench.action.nextEditor, when: no when condition, source: built-in.
2026-05-22 14:58:19.822 [KeybindingService]: + Invoking command workbench.action.nextEditor.       ← second fire (macOS menu accelerator, +8ms)

The first dispatch is the normal keydown event. The second is reported as Dispatching keybinding triggered via menu entry accelerator (macOS native menu), arriving ~8 ms later, invoking the same command. This second dispatch only manifests when the Claude Code webview is in the picture.

Steps to Reproduce

  1. Open a VSCode workspace with at least 3 regular editor tabs (e.g., 3 .py files in a single editor group).
  2. Open the Claude Code panel and choose "Open in New Tab" (Cmd+Shift+Esc) — this puts a Claude Code session in the editor area as an editor-style tab.
  3. Click on any regular file tab to focus it.
  4. Open Command Palette → run "Developer: Toggle Keyboard Shortcuts Troubleshooting" (so dispatches show up in the Output panel).
  5. Press Cmd+Option+Right once.
  • Expected: focus advances by 1 tab.
  • Actual: focus advances by 2 tabs (the Claude Code tab is skipped or two regular tabs are crossed in one press). The Output panel shows TWO Invoking command workbench.action.nextEditor lines, second one labelled "menu entry accelerator".
  1. Close the Claude Code session tab so only regular files remain. Press Cmd+Option+Right — now the navigation is single-step and the log shows only one dispatch. Confirms the bug is triggered by the Claude Code webview.

Things I already tried that did not fix it:

  • Developer: Reload Window
  • Full VSCode restart (Cmd+Q then relaunch)
  • Adding "keyboard.dispatch": "keyCode" to settings.json
  • Rebinding View: Open Next Editor to a different key (e.g. Cmd+Shift+]) — the double-fire follows the command, not the key
  • Verified in Keyboard Shortcuts editor that no other extension is bound to Cmd+Option+Right

Local workaround that partially helps (still affected when entering the Claude Code tab from outside):

// keybindings.json
{ "key": "alt+cmd+right", "command": "workbench.action.nextEditor",     "when": "!webviewFocus && !terminalFocus" },
{ "key": "alt+cmd+left",  "command": "workbench.action.previousEditor", "when": "!webviewFocus && !terminalFocus" }

Claude Model

Sonnet (default) — though the bug is purely in the extension's keyboard/event plumbing and unrelated to the model.

Is this a regression?

I don't know.

Last Working Version

N/A — first time I noticed it.

Claude Code Version

2.1.132 (Claude Code) (CLI). VSCode extension: anthropic.claude-code-2.1.145-darwin-arm64.

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Hypothesis: the Claude Code webview consumes the keydown event without invoking the host-side event.preventDefault() / stopPropagation() flow that would suppress the macOS native-menu accelerator. The webview-routed event fires the keybinding once; the macOS menu accelerator fires it again ~8 ms later because the OS-level menu shortcut was never consumed.

This pattern aligns with previously reported webview / keyboard-event issues:

  • #53055 — Cmd+Esc doesn't blur input in Claude Code panel
  • #47876 — paste/copy shortcuts fail in Remote-SSH due to focus loss
  • #12358 — macOS system shortcuts (Cmd+H, Cmd+M) not working when Claude panel focused

Environment:

  • macOS 26.2 (build 25C56), arm64 (Apple Silicon)
  • VSCode 1.120.0 (commit 0958016b2af9f09bb4257e0df4a95e2f90590f9f)
  • Locale: Korean (IME active during repro — verified it also occurs with English IME)

Suggested fix (Anthropic-side): the Claude Code webview should event.preventDefault() on intercepted keydown events that are not consumed by the webview's own handlers, or route navigation-class keys (alt+arrow / cmd+alt+arrow / ctrl+pageup/pagedown / cmd+1..9) through VSCode's host via postMessage rather than letting the native menu accelerator dispatch a second copy.

Acceptance criteria:

  • With a Claude Code editor tab open, Cmd+Option+Right from a sibling regular tab advances exactly one tab.
  • The Developer Troubleshooting log shows a single Invoking command workbench.action.nextEditor per keypress.
  • No regression on other Claude Code keybindings (Cmd+Esc, Option+K, Cmd+Shift+Esc).

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗