My agent cannot run terminal

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor 3.17.19 (Universal), commit ae3a2b7231dd56194447fe4570dfdc61640b1e90, date 2026-08-24
Layout: Agent Window and main editor Agent (both fail)
Electron 40.10.3, Node 24.15.0, macOS Darwin arm64 25.6.0
Legacy terminal on, run mode auto review
IDE terminal works (echo ok)
Agent Shell: “no exit status / execution environment may need to be restarted”
Other tools: spawn EBADF
Reboot, quit/reopen, new chats already tried

Steps to Reproduce

Steps to reproduce

Open Cursor 3.17.19 (commit ae3a2b7231dd56194447fe4570dfdc61640b1e90) on macOS (Darwin arm64 25.6.0).
Open any workspace (e.g. LexProcessus).
Confirm a normal IDE terminal works:
echo ok && ulimit -n
Expected: ok and a file-descriptor limit.
Open Agent in the main editor (and/or Agent Window).
Optional (still fails either way): turn Legacy Terminal on; set run mode to Auto review.
Ask the agent to run a trivial command, e.g. echo ok.
Actual result

Agent Shell returns: “The shell command returned no exit status, so its result is unknown” (no stdout, no exit code).
Some other spawn-based tools fail with spawn EBADF.
File Read still works.
Expected result

The command runs and prints ok with exit code 0.
Already ruled out

Mac reboot, quitting Cursor, new chats, Agent Window vs editor Agent, sandbox/auto-review, file-descriptor exhaustion (ulimit ~1M, few Cursor processes).

Expected Behavior

To run the commands without any issues

Operating System

MacOS

Version Information

Version: 3.17.19 (Universal)
VS Code Extension API: 1.128.0
Commit: ae3a2b7231dd56194447fe4570dfdc61640b1e90
Date: 2026-08-24T06:42:14.583Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
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
OS: Darwin arm64 25.6.0

For AI issues: which model did you use?

Version: 3.17.19 (Universal)

For AI issues: add Request ID with privacy disabled

67d04f19-7838-453d-926b-0425a4e71ae2

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @kygeorge — thanks for the detailed report, and for everything you’d already ruled out!

This matches an issue we’re currently tracking: on macOS, a background process inside Cursor can accumulate a very large number of open files. Once that happens, the agent’s command execution fails with spawn EBADF / “no exit status”, while the regular IDE terminal continues to work normally.

Related thread: Cursor can only access Terminal with legacy terminal tool on - #15 by Fernando_Abolafio

To clear it:

  1. Fully quit Cursor (Cmd+Q).
  2. Delete the folder ~/Library/Application Support/Cursor/snapshots. This only removes local agent checkpoint data — your code, git history, and settings are untouched.
  3. Relaunch Cursor.

If the issue comes back after that, please let us know — that would be really useful information for us!