Windows 10 / Cursor 3.17.21: Agent Shell returns exit 0 with empty stdout and no side effects

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Cursor 3.17.21 (User Setup)
Windows 10 x64 10.0.19045
PowerShell
Legacy Terminal Tool: ON
Run Mode: Auto-review

Minimal reproduction:

  1. Open a completely empty folder: C:\CursorAgentTest
  2. Open a new Agent chat
  3. Run:
    Write-Output “CURSOR_AGENT_TEST”

Actual:

  • exit code: 0
  • stdout: empty
  • “CURSOR_AGENT_TEST” is not returned

Side-effect test:
Set-Content -LiteralPath “C:\CursorAgentTest\probe.txt” -Value “TEST”

Actual:

  • Agent reports exit code 0
  • probe.txt is not created

Normal PowerShell/integrated terminal works correctly.

The issue reproduces in a clean workspace, so it does not depend on my project, Git repository, .cursor/rules, or project code.

Steps to Reproduce

  1. Install and launch Cursor 3.17.21 (User Setup) on Windows 10 x64.

  2. Open a completely new, empty folder, for example:
    C:\CursorAgentTest

  3. Start a new Agent chat in that workspace.

  4. Ask the Agent to execute only this command in its Agent Shell:

    Write-Output "CURSOR_AGENT_TEST"
    
  5. Observe the result reported by the Agent Shell:

    • Exit code: 0
    • stdout: empty
    • The expected text CURSOR_AGENT_TEST is not returned.
  6. Verify the issue is not limited to stdout capture by asking the Agent to execute:

    Set-Content -LiteralPath "C:\CursorAgentTest\probe.txt" -Value "CURSOR_AGENT_FILE_TEST"
    
  7. Check the folder using a normal Windows PowerShell outside Agent Shell:

    Test-Path "C:\CursorAgentTest\probe.txt"
    
  8. The result is:
    False

    The file is not created, even though the Agent Shell reports exit code 0.

  9. The same commands work normally when executed manually in a regular PowerShell terminal.

The issue reproduces in a clean, empty workspace and does not depend on a project repository, Git configuration, project rules, or project source code.

Operating System

Windows 10/11

Version Information

Cursor IDE
Version: 3.17.21 (User Setup)
Build Type: Stable
Release Track: Default
OS: Windows 10 x64 (10.0.19045)
Architecture: x64
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
Commit: 8f2a112cb2845a97b75fd932ea5c470579ca4060

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the detailed report and the clean repro. What you’re describing, Agent Shell reports exit 0 but the command doesn’t actually run, is a Windows issue we’re tracking. It shouldn’t happen, and it’s not related to your project.

A couple things to try:

  1. In Cursor Settings > Agents, switch Run Mode to a different option and back (for example, to Use Allowlist, then back to Auto-review). Then fully quit Cursor (not Reload Window, a full quit) and open it again. Sometimes a saved value can still affect the agent terminal even if you can’t see it in the UI.

  2. You currently have Legacy Terminal Tool ON. Try turning it OFF instead, fully restart Cursor, and re-run the test. The default terminal path changed a lot, and checking whether behavior changes with Legacy OFF will help narrow this down.

If it still reproduces after both steps, can you share:

  • Your PowerShell version ($PSVersionTable.PSVersion in a normal terminal)
  • Whether a terminal shows up in the Cursor panel when the agent runs the command, and whether you can see the command text in it
  • The Request ID from a failed run (hover the agent message, menu ... > Copy Request ID)

That’ll show where exactly the command is getting lost. Let me know how it goes.

Windows project Agent:
Shell commands execute successfully and return correct exit codes,
but stdout is always empty.

Repro:
echo HELLO
→ exit code 0
→ stdout empty

git --version
→ exit code 0
→ stdout empty

cmd /c “echo HELLO”
→ exit code 0
→ stdout empty

Get-Content test.txt
→ exit code 0
→ stdout empty

However:

  1. Human integrated PowerShell terminal returns stdout normally.
  2. Empty Agent uses Linux bash and returns stdout normally.
  3. Agent file-reading tool returns file contents normally.
  4. Reproduces in a clean unrelated Windows workspace.
  5. Reproduces after reinstalling Cursor system-wide.
  6. Legacy Terminal Tool enabled does not change behavior.
  7. Logs show:
    LocalShellStreamExecutor
    → ShellCoreExecutor
    → NaiveTerminalExecutor
    → exit
    with no PTY/output capture path.

Thanks, that log signature LocalShellStreamExecutor → ShellCoreExecutor → NaiveTerminalExecutor, without PTY or output capture, is exactly what helps narrow this down. It looks like the command is getting to execution (the exit code is correct), but the stdout capture path isn’t being attached. This is a Windows-specific issue we’re tracking, and it’s not related to your project.

A few quick questions to pinpoint it more precisely:

  • In #7 the exit codes are correct now. Are side effects happening too? For example, if you run Set-Content -LiteralPath "C:\CursorAgentTest\probe.txt" -Value "TEST" via Agent Shell, does the file actually get created (with stdout still empty), or is the file still not there? This helps distinguish output not being captured vs the command not executing.

  • PowerShell version. Run this in a normal terminal:

    $PSVersionTable.PSVersion
    
  • The Request ID from a failed run. Hover the agent message, open the ... menu, then Copy Request ID.

With these three items, we’ll be able to see exactly at which step the output is getting lost. I’ll reply here when there’s an update.