Webview captures macOS system shortcuts, preventing cmd+h and other system commands

Resolved 💬 3 comments Opened Feb 11, 2026 by OrestTa Closed Mar 11, 2026

Description

When the Claude Code chat interface (webview) has focus, macOS system-level keyboard shortcuts are captured by the webview and don't reach the operating system. This prevents common system shortcuts from working without first manually clicking outside the Claude chat area.

Steps to Reproduce

  1. Open Claude Code in VSCode (sidebar or panel)
  2. Click in the Claude chat input or anywhere in the Claude interface
  3. Press cmd+h (macOS "Hide Window" shortcut)
  4. Result: Nothing happens - VSCode window doesn't hide
  5. Click on the file explorer or editor
  6. Press cmd+h again
  7. Result: VSCode window hides as expected

Expected Behavior

System-level shortcuts like cmd+h, cmd+m (minimize), and cmd+q (quit) should work regardless of whether the Claude webview has focus, as they do in native VSCode elements.

Actual Behavior

These shortcuts are captured by the webview and don't propagate to the OS, requiring users to manually move focus away from Claude first.

Additional Context

  • The cmd+escape keybinding (defined in package.json line 267-271) to blur Claude also doesn't work when the webview has focus
  • This affects the user experience as it breaks muscle memory for common macOS window management
  • Other VSCode extensions with webviews (like browser previews) typically pass through system shortcuts

Suggested Solution

In the webview's JavaScript code, add event handlers to pass through system-level shortcuts:

window.addEventListener('keydown', (e) => {
  // Pass through macOS system shortcuts
  if (e.metaKey && !e.shiftKey && !e.altKey && !e.ctrlKey) {
    if (['h', 'm', 'q', 'w'].includes(e.key.toLowerCase())) {
      // Let the event bubble to the OS
      return;
    }
  }
  // Handle other shortcuts normally
});

Environment

  • Claude Code Extension Version: 2.1.39
  • VSCode Version: 1.94.0+
  • OS: macOS (Darwin 25.2.0)
  • Location Setting: Panel

Impact

Medium - This is a quality-of-life issue that affects daily workflow for macOS users who rely on keyboard shortcuts for window management.

View original on GitHub ↗

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