Agent Shell tool fails to spawn shell process on WSL (pid: -1)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The AI agent’s Shell tool fails to execute commands when using Cursor on WSL2. The shell process never spawns (pid: -1), resulting in empty output for all commands. The integrated terminal works perfectly - only the agent’s shell execution is affected.

Steps to Reproduce

Open a workspace in Cursor on WSL2
Start an agent conversation
Have the agent attempt to run any shell command (e.g., echo “test”)

Expected Behavior

Shell command executes and returns output.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.48 (user setup)
VSCode Version: 1.105.1
Commit: ce371ffbf5e240ca47f4b5f3f20efed084991120
Date: 2025-12-04T19:26:27.263Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

Additional Information

Environment:
OS: WSL2 (Ubuntu) on Windows - kernel 5.15.167.4-microsoft-standard-WSL2
Shell: bash

Actual Behavior:
Command appears to be sent but never executes
Exit code: -1
Output: empty
Terminal file shows pid: -1 and empty cwd

Diagnostic Details:
Agent-spawned terminal state:
pid: -1cwd: active_command: echo “Hello from shell” && pwd
Manual integrated terminal (working correctly):
pid: 131089cwd: /home/user/projectlast_command: echo testlast_exit_code: 0

Additional Context:
Manual terminal (Ctrl+) works perfectly - Only the agent’s shell tool is affected - No changes were made to WSL or shell configuration - Issue began after recent Cursor update

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

2 Likes

Also happening on nightly

Version: 2.2.0-pre.25.patch.0 (user setup)
VSCode Version: 1.105.1
Commit: 47fec3c2d25a2fe4275cad5c6b96418a41068e30
Date: 2025-12-04T19:34:48.588Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

Got the exact same problem

Working correctly on version 2.1.42.

Also solved Accept Editing File Bug (since 2.0v) for me.

Would appreciate some way to be notified when the underlying issue is solved in a new release, a link to related github issue I can sub to maybe?

Anyone else looking to downgrade old version can be found here: GitHub - oslook/cursor-ai-downloads: All Cursor AI's official download links for both the latest and older versions, making it easy for you to update, downgrade, and choose any version. 🚀

1 Like

How did you downgrade? I tried downloading 2.1.42 and installing it overtop of 2.1.48, but I still have this bug. Do I need to do a complete uninstall? Any special considerations for WSL?

Add these lines to your User Settings to prevent it automatically updating (Accessed via Ctrl + Shift + P → “Preferences: Open User Settings (JSON)”)

“update.enableWindowsBackgroundUpdates”: false,
“update.mode”: “none”

Then just exit cursor and run the lower version installer.

There might be something more you need to do if you have cursor installed inside WSL, but if it’s just installed as a windows app and connected to WSL through Remote Development that’s all I did.

Got it working! Thank you sir.

1 Like

I am having the same issue. I rolled back to 2.1.42 didn’t solve it. went back to 2.1.41, didn’t work either. created a support ticket for it:

Version: 2.1.41 (user setup)
VSCode Version: 1.105.1
Commit: 1321aa9140784391e83a406174345e818fe156f0
Date: 2025-11-30T18:58:57.968Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

grep tool is failing to spawn as well.

Having same issue.

Still happening on new version.

Version: 2.1.50 (user setup)
VSCode Version: 1.105.1
Commit: 56f0a83df8e9eb48585fcc4858a9440db4cc7770
Date: 2025-12-06T23:39:52.834Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

1 Like

Calling command line sometimes worked and sometimes failed…

Version: 2.1.50 (user setup)
VSCode Version: 1.105.1
Commit: 56f0a83df8e9eb48585fcc4858a9440db4cc7770
Date: 2025-12-06T23:39:52.834Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.22631

This solution worked for me, thanks! But I think we should have an official fix on next patches from cursor team. Can anyone from cursor team look at this?

1 Like

I am still having this problem and haven’t seen a solution provided. I have resorted to using other agents for shell execution and limiting the agent to modifying files but this is not acceptable even in the mid-term.

Is a solution forthcoming?

Commenting again to state that for some reason, console commands to WSL started working again after 3 days of failures without even upgrading Cursor to a new version or even restarting the IDE!! Go figure…

Fixed on:

Version: 2.2.14 (user setup)
VSCode Version: 1.105.1
Commit: 1685afce45886aa5579025ac7e077fc3d4369c50
Date: 2025-12-11T01:12:35.790Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.