Cursor on Windows repeatedly spawns hundreds of external Git Bash/MSYS2 windows while Agent is generating code.
Each window title is:
/usr/bin/bash --login -i C:\Users\Sorin.cursor\plugins\cache\cursor-public\deploy-on-a…
Normal terminal profile is set to PowerShell, but Cursor still launches external bash windows from .cursor\plugins\cache\cursor-public. Terminal: Kill All Terminals does not close them because they are external Windows processes, not integrated terminal tabs.
Cursor should run commands in one controlled integrated terminal, or ask for approval before running commands. It should not spawn external Bash windows repeatedly.
Hey, thanks for the detailed report. I can see the screenshot with dozens of Git Bash windows, all with the same title from .cursor\plugins\cache\cursor-public\deploy-on-a... and that’s the source.
What’s happening: one of the plugins (cursor-public, deploy-on-a...) registers a hook on every file edit (afterFileEdit), and the hook command points to a .sh script. On Windows, a raw .sh path doesn’t go through Cursor’s bundled shell, it goes through the system file association. Since you have Git for Windows installed, .sh is associated with bash --login -i "%1", so every hook run opens a new external Git Bash window. The hook triggers on every edit, so during generation you end up with hundreds. The terminal profile (PowerShell) doesn’t matter here, and Kill All Terminals won’t close them because they’re external processes.
How to fix it right now:
Open Cursor Settings > Hooks and check the list of registered hooks. You’ll see a hook from cursor-public or deploy-on-a... pointing to a .sh.
Fastest option is to disable that plugin. The per-edit hook will stop firing and the windows will stop.
We know about this mechanism (hooks calling .sh via the OS file handler on Windows). I’ve reported your case with the external windows internally. I can’t share a timeline for a fix yet. Let me know which plugin was the culprit and whether the steps above helped.
I checked the Hooks menu and I found only a single one defined, that is unrelated to my situation. I attach a screenshot with it. This hook is not used when I ask the agent to generate some code, because my issue is happening even in new projects, that doesn’t have AWS integrated in any way
Thanks for the screenshot, it shows the source of the issue. The deploy-on-aws config hook type postToolUse, path .cursor\plugins\cache\cursor-public\deploy-on-aws\..., is the one.
The confusing part is that even though it’s called “deploy-on-aws”, this hook isn’t tied to AWS in your project. postToolUse runs after every agent tool call, meaning after every file edit, no matter if the project uses AWS or not. That’s why it also triggers in new projects. And the path shown in the title of the external Git Bash windows from your first report ...\cursor-public\deploy-on-a... matches this hook exactly.
What to do now:
Disable or uninstall the cursor-public / deploy-on-aws plugin. The hook will stop running and the external windows should stop.
We’ve already reported the underlying issue on our side, the hook calling a .sh ends up going through Windows file associations. I can’t share an ETA for a fix yet. Let me know if the windows stop after you disable the plugin.