[BUG] VS Code extension: Ctrl+Shift+Esc opens a new Claude Code panel but focus stays in the editor (Linux)
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?
With focus in an editor file and no Claude Code panel open, pressing Ctrl+Shift+Esc (claude-vscode.editor.open) opens a new Claude Code panel beside the editor. Keyboard focus does not land in the Claude Code input. It also leaves the editor file. No element shows a caret. VS Code keybindings still work in this state: Ctrl+1 moves focus to the editor file, and Ctrl+Esc (claude-vscode.focus) moves focus to the editor file first and to the Claude Code input only on a second press.
Related, not duplicates:
- #18266:
claude-vscode.focusdoes not focus the panel on Linux. Closed as not planned. This report covers the open-panel shortcut on a current version. - #88430: on Windows, a newly loaded panel leaves its input unfocused and swallows every VS Code keybinding until a mouse click. Here keybindings keep working, so the state is recoverable from the keyboard, but the input focus is missing in the same way.
- #78698: Alt+K and Ctrl+Esc do not focus the input when the panel is in an auxiliary window. This report uses one main window.
What Should Happen?
When Ctrl+Shift+Esc opens a Claude Code panel, keyboard focus should move to the input field of that panel immediately. One shortcut should be enough to start typing a prompt.
Error Messages/Logs
Steps to Reproduce
- Open VS Code with a workspace and one file in the editor. Make sure no Claude Code panel is open.
- Click into the editor file so that it has keyboard focus.
- Press Ctrl+Shift+Esc.
- A Claude Code panel opens beside the editor.
- Start typing. The focus is neither on the editor file, nor the Claude Code input.
- Press Ctrl+Esc. The focus moves to the editor file.
- Press Ctrl+Esc again. Only now does the focus move to the Claude Code input.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.152 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
- OS: Ubuntu 22.04.5 LTS, GNOME, Wayland session
- VS Code: 1.137.0 (645f29cc3176500b4b5762ba887cf2a7f0ffdf2c), x64
- Extension: anthropic.claude-code 2.1.268 (linux-x64)
- Workaround and hint at the cause: in the broken state, press Ctrl+E to open Quick Open, then Esc to close it. Focus lands in the Claude Code input. VS Code restores focus to the last focused part, which is the Claude panel webview, and the webview then focuses its input. So the panel gets focus when it opens, but the input inside the webview does not. This points to an input focus call that runs before the webview is ready, as #78698 and #88430 suggest.
- A similar problem exists when a Claude Code panel is already open and the shortcut opens a second one. See the separate report about the VS Code window losing OS-level focus in that case.