Cursor Agent Fails to Run any Terminal Commands

Description
I’m experiencing an issue where the Cursor agent fails to execute simple terminal commands, such as running a Python script, despite Python being installed and added to PATH. When I prompt to execute a basic hello_world.py script through Cursor Composer in Agent mode, I receive a CommandNotFoundException error.

However, when I open a terminal manually in VS Code, I can run the same commands without any issue. When Cursor tries to execute the same commands, I get the following error message:

The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe '-l'" terminated with exit code: 1.

Steps to Reproduce:

  1. Open Cursor with a clear workspace (Empty directory).
  2. In Composer Agent mode, prompt Cursor with:
create a hello world python file and call it in terminal
  1. Cursor creates a hello_world.py file with the following content:
print("Hello, World!")
  1. Observe that Cursor fails to execute the script, showing an error such as CommandNotFoundException. And a vscode pop up message with:
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe '-l'" terminated with exit code: 1.
  1. Open a manual terminal in VS Code and run the same commands agent is failing at:
python hello_world.py
  1. The script executes successfully, confirming that Python is installed and available in PATH, reachable from the VS Code terminal.

System Information:

  • OS: Windows 11 Enterprise (22631.4890)
  • Cursor Version: 0.45.11
  • VS Code Version: 1.96.2

Attachments:
Screenshot of Cursor failing to run the command and the same command running successfully in VS Code Terminal:

Additional Notes:
This issue prevents me from using one of Cursor’s main features; Agent.

i think this is happening because cursor doesnt have enough permissions to work with powershell on your system. can you try to uninstall and do a fresh install of cursor, then give it all permissions and then try this?

1 Like

Yes, apparently it can’t run any cmd command at all; I prompted it to just test with an echo command at it also failed:

It of course works when I try to run it manually in vscode terminal.

I’ll try doing a fresh install. Are any extra steps required for a “clean install” or should I just uninstall and install?

Before trying a clean install; I tried running cursor as admin and it seemed to have did the trick somehow :person_shrugging:

Now it works even if I don’t run it as admin.

I guess this can be marked as ‘solved’?

1 Like