Agent Shell tool fails on Remote SSH (exit code -1, pid: -1)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor Version: 2.1.50
OS: Windows 10 (build 26200)
Remote: Ubuntu VPS via Remote SSH

Issue:
Agent-initiated terminal commands fail with exit code -1. Terminal file shows pid: -1 and empty cwd.

Manual terminal works perfectly - I can run commands directly. But when the AI agent uses the Shell tool, it fails silently.

Tried:

  • PC restart
  • Remote server reinstall (Kill VS Code Server on Host)
  • Developer: Reload Window

Expected: Agent should be able to run shell commands on remote server
Actual: All agent shell commands return exit code -1 with no output

Steps to Reproduce

  1. Connect to Ubuntu VPS via Remote SSH
  2. Open a workspace on the remote server
  3. Use Agent mode and ask it to run any shell command
  4. Agent’s Shell tool fails with exit code -1
  5. Check terminal file - shows pid: -1 and empty cwd
  6. Manual terminal (Ctrl+`) works perfectly - only AI-initiated commands fail

Expected Behavior

Agent should be able to execute shell commands on the remote server, just like manual terminal works.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.50
VSCode Version: 1.105.1
Commit: 56f0a83df8e9eb48585fcc4858a9440db4cc7770

For AI issues: add Request ID with privacy disabled

Claude Opus 4.5 (Agent mode) or sonnet.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Found the solution:

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