Cursor Agent repeatedly spawns hundreds of external Git Bash/MSYS2 terminals on Windows

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

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.

Steps to Reproduce

  1. Open project in Cursor on Windows.
  2. Ask Cursor Agent to generate or modify code.
  3. Cursor starts opening external Git Bash/MSYS2 windows.
  4. The number of windows keeps increasing.
  5. Cursor becomes unusable.

Expected Behavior

Cursor should run commands in one controlled integrated terminal, or ask for approval before running commands. It should not spawn external Bash windows repeatedly.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

Version: 3.8.22 (user setup)
VS Code Extension API: 1.105.1
Commit: 46fb7aafe279d7c72346febe68c2e004b7d1de60
Date: 2026-06-22T21:41:16.291Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.19045

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

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:

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.

Hey Dean,

Thanks for the reply!

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:

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.

Sorry for the late reply.

I tried it out as you said and I can confirm the issue is gone if I disable the plugin.

Thanks for your patience!

Cheers!