Agent Shell fails in Agents Window but succeeds in IDE mode on Windows

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Agent Shell fails in Agents Window but succeeds in IDE mode on Windows

Steps to Reproduce

In the Agents Window, running:
cmd /c echo ok
returns:

The shell command returned no exit status
The same command succeeds in IDE mode with exit code 0 and outputs ok.

Reloading the window, restarting cursor, and creating a new chat do not resolve the issue in the Agents Window.

Operating System

Windows 10/11

Version Information

Environment
Cursor 3.12.17
Commit: 0fb762053c34788bb7760d5673f8a6d4c8589d50
Windows 10.0.26200 x64

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. This is a known Windows-specific case. On Windows, agent sandbox only works as a network proxy with no filesystem isolation. If Auto-Run in Sandbox is saved in settings, then shell-exec in the Agents Window closes the stream without an exit event, which leads to no exit status. In IDE mode the path is different, so the command completes there.

Two ways to fix it:

  1. Turn on Settings > Agents > Inline Editing & Terminal > Legacy Terminal Tool. This bypasses the sandbox path completely.
  2. Or switch Settings > Agents > Auto-Run from sandbox mode to Use Allowlist.

Even if the sandbox option isn’t shown in your current build, a previously saved value can stay active and keep breaking the terminal in the Agents Window until you switch it manually, so it’s worth explicitly setting one of the options above.

Let me know if it helped. If the issue still happens after switching, please share the exthost logs: %APPDATA%\Cursor\logs\...\exthost\anysphere.cursor-agent-exec, and we can dig deeper.