claude-code - 💡(How to fix) Fix [BUG] ALT+TAB back to VS Code extension causes certain key presses (e.g., PrtSc, Henkan) to trigger menu bar focus

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Root Cause

The root cause is likely that the ALT keyup event from ALT+TAB is not delivered correctly to the webview context. Keys that generate IME-specific or system-level Windows messages bypass the webview and interact with the residual ALT state at the parent VS Code window level, triggering menu bar focus.

Fix Action

Fix / Workaround

Workaround: Pressing Ctrl once after returning to VS Code clears the stuck ALT state, after which the problematic keys work correctly. Pressing Pause, Scroll Lock, or Num Lock also clears the state, instead of causing the problem.

Code Example

N/A
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

After switching back to VS Code via ALT+TAB, pressing certain keys in the Claude Code prompt editor causes the menu bar to receive focus, as if ALT were pressed alone.

Any subsequent keypresses then operate on the menu, which can trigger unintended destructive commands.

The affected keys include: Henkan (変換), Muhenkan (無変換), Eisu (英数), and PrtSc. Regular character keys and keys such as Insert, Pause, Scroll Lock, and Num Lock are not affected.

What Should Happen?

  • Henkan (変換), Muhenkan (無変換), and Eisu (英数) should control the IME
  • PrtSc should not affect focus
  • Pressing ALT while the prompt editor is focused moves focus to the menu bar; pressing ALT again should return focus to the prompt editor

Error Messages/Logs

N/A

Steps to Reproduce

  1. Focus the Claude Code extension's prompt editor in VS Code
  2. Switch to another application using ALT+TAB
  3. Switch back to VS Code using ALT+TAB
  4. Press PrtSc, Henkan (変換), Muhenkan (無変換) or Eisu (英数)
  5. Confirm the menu bar is focused
  6. (additional) Press ALT key to see that it does not bring the focus back to the prompt editor

Workaround: Pressing Ctrl once after returning to VS Code clears the stuck ALT state, after which the problematic keys work correctly. Pressing Pause, Scroll Lock, or Num Lock also clears the state, instead of causing the problem.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.87 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

Other

Additional Information

  • This issue does not occur in the VS Code main editor (Monaco), integrated terminal, or GitHub Copilot Chat panel — only in the Claude Code prompt editor
  • Pressing ALT as a second time on the menu bar does not return focus to the prompt editor (it does in GitHub Copilot Chat). I do not see this is a related issue or not.
  • ALT+TAB alone occasionally moves focus to the menu bar without any subsequent key press, though this is not consistently reproducible. I do not see this is a related issue or not.

The root cause is likely that the ALT keyup event from ALT+TAB is not delivered correctly to the webview context. Keys that generate IME-specific or system-level Windows messages bypass the webview and interact with the residual ALT state at the parent VS Code window level, triggering menu bar focus.

Additional environment detail: Japanese 109 keyboard is used. The primary affected keys (Henkan, Muhenkan, Eisu) are Japanese IME control keys specific to Japanese 109 keyboards. PrtSc also reproduces the issue and is not keyboard-layout-specific, but the practical impact is concentrated on IME users (Japanese, Korean, Chinese, etc.) who tend to press IME keys immediately after returning to VS Code.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING