How to fix Cursor Agent shell tool output empty / hanging on Windows?

OS: Windows 10/11

Cursor Version: Version 3.18.9

Shell Profile: PowerShell / CMD

Issue Description:

When the Cursor Agent runs terminal commands in the background on Windows, it fails to capture any stdout/stderr output, and the command hangs until timing out. However, running the exact same command manually in the integrated terminal works fine.

Question:

How can I fix or resolve this Windows Agent terminal output issue? Is there a known setting adjustment or fix available?

Thanks!

Hey @JJYEN, thanks for the report!

What you’re describing (agent commands hanging with no output on Windows, while the same command works fine in the integrated terminal) is a known issue we’re tracking with agent shell sessions on some Windows setups. It’s not something wrong with your project or configuration.

Could you try opening Cursor Settings > Agents > Terminal and Editing and enable “Legacy Terminal Tool”. Then fully quit Cursor (not just Reload Window, check Task Manager for leftover Cursor processes) and reopen it. This switches the agent to a different shell execution path and resolves this for most people.

HI @Colin

I followed the suggestion to enable “Legacy Terminal Tool” under Cursor Settings > Agent > Terminal & Editing, completely killed all background Cursor/Node processes via Task Manager, and restarted Cursor.

I then tested it with the Agent using the command echo "cursor-terminal-stdout-test".

Result:

  • The command executed and finished with exit code 0 (~453 ms).

  • However, the Agent still received empty stdout/stderr (Command output: blank).

It seems switching to the Legacy Terminal Tool does not resolve the Windows PTY stdout capture bug in my environment. Looking forward to an official fix for Windows.

Hm. Thanks for following up. Could you try asking the agent to run this command? It writes a small text file to your Desktop instead of relying on the output.

Set-Content -LiteralPath ($env:USERPROFILE + '\Desktop\cursor-agent-probe.txt') -Value ($PSHOME + ' | ' + $PSVersionTable.PSVersion + ' | ' + [Console]::IsOutputRedirected + ' | ' + $Host.Name)

Then try opening cursor-agent-probe.txt on your Desktop yourself. Tell us whether the file exists, and paste its contents here!

HI @Colin
I had the Agent execute the PowerShell command as requested. Here is the log of what happened:

The Agent ran the Set-Content command. It reported an exit code of 0, but no file was actually created on my Desktop.

The Agent then tried to run Get-Content to read the file, which returned an empty output.

Finally, the Agent ran Test-Path to verify if the file existed, and that also returned empty output, confirming the file was never written by the Agent process.

Hey @JJYEN, thanks for running that.

Next step: let’s see which PowerShell Cursor is actually finding. Open Cursor’s own terminal panel, run these, and run the following (please share the outputs):

where.exe pwsh powershell
$PSVersionTable.PSVersion
$PSHOME
$PROFILE
Test-Path $PROFILE
Get-ExecutionPolicy -List

If Test-Path prints True, please also paste the contents of the file at the $PROFILE path.

Hi, @Colin thanks for the guidance!

Earlier when I ran where.exe pwsh powershell, it returned Information: Could not find "pwsh". After seeing that, I installed PowerShell 7 on my system.

I then asked the agent to run the command you provided:
Set-Content -LiteralPath ($env:USERPROFILE + ‘\Desktop\cursor-agent-probe.txt’) -Value ($PSHOME + ’ | ’ + $PSVersionTable.PSVersion + ’ | ’ + [Console]::IsOutputRedirected + ’ | ’ + $Host.Name)

The cursor-agent-probe.txt file was successfully created on my Desktop, and the Cursor Agent can now execute shell commands properly.

Thank you so much for your help and support!