[BUG] New session created via keyboard shortcut traps keyboard focus in the webview panel
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?
Creating a new Claude Code session/tab via keyboard shortcut (claude-vscode.editor.open, bound to cmd+shift+escape) traps keyboard focus inside the new webview panel. Typing does nothing, and pressing the shortcut again does not open another session. Mouse clicks still work normally elsewhere in VS Code.
What Should Happen?
The new session's chat input should receive keyboard focus automatically, and the shortcut should remain usable to open further sessions.
Error Messages/Logs
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
Unrecognized feature: 'local-network-access'.
Remote Control error: disabled by your organization's policy
Error Messages/Logs
Steps to Reproduce
- In VS Code, with claudeCode.useTerminal set to false (native UI mode), trigger the shortcut bound to claude-vscode.editor.open (default cmd+shift+escape) to create a new session.
- Try to type in the new session's chat input.
- Keyboard input does nothing; the shortcut also stops firing.
- Click into a regular file editor tab; keyboard input works there immediately, confirming focus is stuck in the webview rather than the whole window being frozen.
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.228 (Claude Code) [CLI], VS Code extension 2.1.237
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Every new session also logs a "Remote Control error: disabled by your organization's policy" message (org policy disables that feature); unrelated to this bug but noted in case it's tied to the same session-init code path that handles focus.