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?
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.
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.
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.
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):
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.