Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor Agent Shell Hang / Slow Startup on Windows
This is the result of a 6+ hour debug session, after which I despise Windows even more.
Bug report documenting agent terminal behavior observed while working on a SvelteKit repo (August 2026).
Summary
On Windows, Cursor agent shell commands either hang indefinitely (Git Bash) or complete successfully but with large fixed overhead (PowerShell), while the same commands run in the integrated terminal in under ~500 ms.
This is not caused by project configuration, shell profiles, or the commands themselves.
Workaround found: enable Legacy Terminal in Cursor settings, then reload the window. Agent shell overhead dropped from ~17–31 s to ~1 s per invocation (command body ~13 ms).
Without Legacy Terminal, the default agent shell integration on Windows appears broken or unusably slow.
Environment
| Item | Value |
|---|---|
| OS | Windows 11 Pro, 25H2 |
| OS build | 26200.8875 (installed 14 Jul 2025) |
| Feature Experience Pack | 1000.26100.334.0 |
Node process.platform |
win32 (build 10.0.26200 — legacy version tuple) |
| Editor | Cursor 3.14.7 (a758f2241ca99fecf380180b6cbdbbce0f1f42c0, x64) |
| Cursor install path | %LOCALAPPDATA%\Programs\cursor\ |
| Legacy Terminal | On (Settings → search “legacy terminal”) — reload required after toggling |
| Workspace | C:\TEMP\GitHub\videoscan |
Workspace .vscode/settings.json |
No terminal settings — only "*.css": "tailwind" |
| Cursor user settings | "terminal.integrated.defaultProfile.windows": "Git Bash" (initial); switched to PowerShell during debugging |
| PowerShell profile | None (Test-Path $PROFILE → False) |
| PowerShell 7 (current) | 7.6.4 via winget |
| PowerShell 7 path (current) | C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.4.0_x64__8wekyb3d8bbwe\pwsh.exe |
| Stale install (removed) | C:\Program Files\PowerShell\7\pwsh.exe — 7.6.3 |
Symptoms
1. Git Bash — commands hang or abort
With Git Bash as the default terminal profile (Cursor user settings):
- Agent
Shelltool calls never completed promptly - Simple commands like
echo okandgit statuswere interrupted after ~90 seconds with no usable output - Non-shell tools (
Read,Grep,Glob) continued to work normally
2. PowerShell (default agent shell) — commands work but are much slower than native
After switching the default terminal profile to PowerShell (Cursor user settings), without Legacy Terminal:
- Commands do complete with exit code
0 - Every command incurs significant fixed overhead, largely independent of command complexity
Agent timings — initial session (PowerShell 7.6.3 + stale Program Files install):
| Command | Agent time | Exit |
|---|---|---|
echo ok |
~31.1 s | 0 |
cmd /c echo ok-from-cmd |
~27.2 s | 0 |
powershell -NoProfile -Command "echo ok" |
~28.7 s | 0 |
echo ok-direct |
~28.1 s | 0 |
Agent timings — after PowerShell 7.6.4 upgrade (winget, stale 7.6.3 removed), Legacy Terminal off:
| Command | Agent time | Exit | Notes |
|---|---|---|---|
echo agent-shell-ok |
~17.3 s | 0 | |
pwsh -NoProfile -Command '$PSVersionTable.PSVersion' |
~17.6 s | 0 | Reports 7.6.4 |
pnpm test:unit |
~19.7 s | 0 | Vitest itself: 204 ms, 12 tests passed |
Agent timings — Legacy Terminal on + window reload:
| Command | Agent time | Exit | Notes |
|---|---|---|---|
echo post-reload-test |
~0.9 s | 0 | |
Measure-Command { echo ok } |
~13 ms (command body) | 0 | Agent wall time ~0.95 s |
Same machine, user’s integrated terminal:
Measure-Command { powershell -NoProfile -Command "exit 0" }
# TotalMilliseconds: ~481
powershell -NoProfile -Command "echo ok"
# ok — no perceptible delay
Dual PowerShell 7 installs (Windows-specific)
After winget upgrade Microsoft.PowerShell, two pwsh.exe locations coexisted:
| Profile / path | Version |
|---|---|
C:\Program Files\PowerShell\7\pwsh.exe |
7.6.3 (stale) |
%LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exe |
7.6.4 (winget app alias) |
where.exe pwsh listed Program Files first, so PATH and the PowerShell 7 terminal profile opened the old build. Cursor’s auto-detected PowerShell profile used the WindowsApps alias (7.6.4).
Resolved by removing the stale 7.6.3 install and confirming agent pwsh resolves to 7.6.4 under WindowsApps.
Steps to Reproduce
Steps to Reproduce
- Open this repo (or any repo) on Windows 11 in Cursor.
- Ensure Legacy Terminal is off (default).
- Set
"terminal.integrated.defaultProfile.windows": "Git Bash"in Cursor user settings (this repo’s.vscode/settings.jsonhas no terminal config). - Ask the agent to run
echo okvia the Shell tool. - Observe: command hangs or is aborted after a long timeout (~90 s).
Then (PowerShell, Legacy Terminal off):
- Change the default profile to
"PowerShell"in Cursor user settings. - Reload Cursor (or start a new agent session).
- Ask the agent to run
echo okagain. - Observe: command succeeds but takes ~17–31 s end-to-end (varies with PowerShell install state).
Workaround (Legacy Terminal on):
- Enable Legacy Terminal in Cursor settings.
- Developer: Reload Window (toggle alone is not enough if the session started before the change).
- Ask the agent to run
echo okagain. - Observe: command succeeds in ~1 s with correct output and exit code.
Compare with running the same command manually in the integrated terminal — completes in < 1 s.
Expected Behavior
Expected Behavior
Agent shell commands should:
- Start and finish with overhead comparable to the integrated terminal (on the order of hundreds of milliseconds, not tens of seconds)
- Not hang indefinitely on Git Bash for trivial non-interactive commands
- Not require Legacy Terminal, shell profile changes, or other hidden settings as a workaround
Actual Behavior
- Git Bash: agent shell appears broken (hang / timeout)
- PowerShell (default agent shell, Legacy Terminal off): works but adds ~17–31 s fixed overhead per invocation
- Legacy Terminal on + reload: agent shell works at ~1 s wall time — acceptable, but a undocumented workaround
-NoProfiledoes not help the agent (user has no profile file anyway)- Overhead without Legacy Terminal is in Cursor agent shell integration, not in PowerShell startup or test runtime
- Agent shell wrapper may use Windows PowerShell 5.1 syntax rules —
&&fails; use;instead
Operating System
Windows 10/11
Version Information
Version: 3.14.7 (user setup)
VS Code Extension API: 1.128.0
Commit: a758f2241ca99fecf380180b6cbdbbce0f1f42c0
Date: 2026-07-30T06:41:34.009Z
Layout: IDE
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.291
OS: Windows_NT x64 10.0.26200
For AI issues: which model did you use?
Composer 2.5 Fast
Additional Information
Ruled Out
| Hypothesis | Result |
|---|---|
PowerShell $PROFILE scripts |
Ruled out — profile does not exist |
powershell -NoProfile |
Ruled out — agent still ~28 s (before upgrade, Legacy Terminal off) |
Project .npmrc / script-shell |
Ruled out — .npmrc has no shell override |
| Command complexity | Ruled out — echo ok same order of cost as pnpm test:unit agent wall time (Legacy Terminal off) |
| CRLF in repo shell scripts | Separate issue; fixed for scripts/*.sh, unrelated to agent spawn time |
| Stale PowerShell 7.6.3 install | Partial factor — removing it reduced overhead ~28 s → ~17 s; did not fix root cause alone |
| Antivirus exclusions | Not tested — user declined; native terminal speed (~481 ms) without AV changes suggests AV is unlikely to be the primary cause |
Workaround
- Enable Legacy Terminal in Cursor settings, then reload the window — reduces agent shell overhead from ~17–31 s to ~1 s.
- Set
"terminal.integrated.defaultProfile.windows": "PowerShell"in Cursor user settings (Git Bash breaks the agent entirely). - Ensure only one PowerShell 7 install is on PATH (
where.exe pwsh→ single 7.6.4 entry). - In agent shell commands, use PowerShell
;separators instead of&&.
Suggested Fix (for Cursor team)
- Fix the default agent shell integration on Windows — it should not require Legacy Terminal.
- Make Legacy Terminal setting take effect without a full reload, or document the reload requirement.
- Investigate why the non-legacy path adds ~17–31 s per command vs ~1 s with Legacy Terminal.
- Fix or document Git Bash compatibility for agent automation on Windows.
- Document which PowerShell executable the agent invokes on Windows.
Related forum threads
Same problem family on Windows (agent shell vs integrated terminal). This report adds the slow-but-working symptom and the Legacy Terminal + reload workaround.
| Thread | Symptom |
|---|---|
| Agent terminal hangs — no exit status | Total failure, no exit status |
| Legacy terminal required | Agent only works with Legacy Terminal |
| Agent shell — no exit status on Windows 11 - agent-shell-commands-never-execute-on-windows-11-no-exit-status/166112) | No exit status on Windows 11 |
| Agent terminal — no captured output - windows-agent-terminal-tool-no-captured-output-0ms-exit-0-integrated-cmd-works-legacy-terminal-enabled-powershell-blocked-by-policy/156312 | Legacy Terminal + policy issues |
References
- This repo’s
.vscode/settings.json— editor only (files.associationsfor Tailwind CSS); not related to the bug - Cursor user settings — where
terminal.integrated.defaultProfile.windowswas changed during debugging - Cursor endpoint security docs/enterprise/endpoint-security — AV exclusion guidance (not tested; listed for completeness only)
- Related prior issue in this project: Git Bash +
script-shell=bash.exein.npmrccaused invisible background processes (reverted; not the same as this agent bug)
PowerShell upgrade notes
winget upgrade --id Microsoft.PowerShell --exact
where.exe pwsh
pwsh -NoProfile -Command '$PSVersionTable.PSVersion; (Get-Command pwsh).Source'
If two versions appear, remove the stale install via Settings → Apps or winget uninstall Microsoft.PowerShell followed by a fresh winget install.
Other resolved issues (same session)
- PSReadLine warning on terminal open (PowerShell 7.6.4 / WindowsApps): fixed by
Install-Module PSReadLine -Scope CurrentUserand full Cursor restart (taskkill /IM Cursor.exe /F).
Generated from a debugging session while setting up integration tests in the videoscan SvelteKit project. Updated after PowerShell 7.6.4 upgrade, Legacy Terminal workaround, and post-reload retest.
Does this stop you from using Cursor
No - Cursor works, but with this issue