Spawn C:\Program Files\PowerShell\7\pwsh.exe ENOENT

Where does the bug appear (feature/product)?

Somewhere else…

Describe the Bug

Agent can’t run commands inside the chat. It keeps saying spawn C:\Program Files\PowerShell\7\pwsh.exe ENOENT even if PowerShell is located exactly there.

Steps to Reproduce

Ask Agent to run any code line.

Expected Behavior

Agent should run code in PowerShell

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.7.39 (system setup)
VSCode Version: 1.99.3
Commit: a9c77ceae65b77ff772d6adfe05f24d8ebcb2790
Date: 2025-10-08T00:33:20.352Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

For AI issues: which model did you use?

GPT 5
Sonnet 4.5
Auto

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. This is a known issue with the new Agent terminal in recent versions.

Workaround:

  • Open Cursor Settings > Chat > Inline editing & Terminal “Legacy Terminal Tool”
  • Enable “Legacy Terminal Tool”
  • Restart Cursor
  • Try running Agent commands again

This should fix the ENOENT error and let the Agent run commands properly.

The new terminal doesn’t correctly respect Windows terminal profiles. The Legacy Terminal Tool is a temporary workaround while the team fixes the root bug.

Let me know if this helps.

Thank you, it did fix the problem.