VSCode extension steals focus from GPG pinentry dialog during git operations
Description
When running git commands that require GPG signing (commit, push) via the VSCode extension, the GPG pinentry dialog appears but VSCode/the extension immediately reclaims focus. This causes keystrokes intended for the GPG passphrase to be sent to the Claude Code chat input instead.
This is related to #118 (now locked/closed) which described terminal screen flickering with curses-based pinentry. This issue is specific to the VSCode extension with a GUI pinentry (e.g., pinentry-w32 on Windows).
Steps to Reproduce
- Have GPG commit signing enabled (
git config commit.gpgsign true) - Use Claude Code VSCode extension to run a
git commitorgit push - The GPG pinentry window appears on top
- Start typing your passphrase
Expected Behavior
Keystrokes should go to the GPG pinentry dialog.
Actual Behavior
The pinentry dialog is visible and stays on top, but focus returns to the Claude Code chat input. Passphrase keystrokes are accidentally entered into the chat instead of the pinentry dialog.
Environment
- OS: Windows
- Claude Code: VSCode extension
- GPG: pinentry-w32 (GUI pinentry)
Workarounds
From #118 discussion:
- Use SSH signing instead of GPG (
git config gpg.format ssh) - Cache GPG passphrase longer via gpg-agent
- Manually click the pinentry window before typing
Note
This may require coordination with VSCode's focus management APIs to properly yield focus to external dialogs.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗