[BUG] Windows 11: Git bash window pops up and steals typing focus during background operations
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?
During Claude Code operation on Windows 11, a Git bash window (C:\Program Files\Git\cmd\) repeatedly pops up and steals keyboard focus, making it impossible to type.
Environment
- OS: Windows 11
- Claude Code: v2.1.140
- Git: 2.54.0
Steps to Reproduce
- Run Claude Code on Windows 11
- Wait for any background git operation (auto-commit, git status check, etc.)
- Git bash window appears and steals focus from active window
Root Cause (suspected)
child_process.spawn calls bash.exe without windowsHide: true option
Attempted Fixes (all failed)
- Changed VS Code default terminal profile to PowerShell
- Changed Windows Terminal default profile to PowerShell
- Reinstalled Git
- Set SHELL environment variable to PowerShell
- Ran claude directly from PowerShell
What Should Happen?
During Claude Code operation on Windows 11, a Git bash window (C:\Program Files\Git\cmd\) repeatedly pops up and steals keyboard focus, making it impossible to type.
Environment
- OS: Windows 11
- Claude Code: v2.1.140
- Git: 2.54.0
Steps to Reproduce
- Run Claude Code on Windows 11
- Wait for any background git operation (auto-commit, git status check, etc.)
- Git bash window appears and steals focus from active window
Root Cause (suspected)
child_process.spawn calls bash.exe without windowsHide: true option
Attempted Fixes (all failed)
- Changed VS Code default terminal profile to PowerShell
- Changed Windows Terminal default profile to PowerShell
- Reinstalled Git
- Set SHELL environment variable to PowerShell
- Ran claude directly from PowerShell
Error Messages/Logs
Steps to Reproduce
- Run Claude Code on Windows 11
- Wait for any background git operation (auto-commit, git status check)
- Git bash window (C:\Program Files\Git\cmd\) appears and steals keyboard focus
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.140
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗