I hit a terminal failure in Cursor that looked like:
- Error initializing PTY: posix_spawnp failed
- Turbo/Next runs failing with:
- failed to openpty: Os { code: 6, message: “Device not configured” }
- Sometimes also seeing:
- OSError: out of pty devices
Impact
- Integrated terminal became unstable / closed.
pnpm devfailed before app code started.- Eventually reproduced in regular Terminal too (system-wide PTY exhaustion).
Root Cause
Cursor had leaked a large number of orphan terminal helper processes:
- cursor-shell processes with ppid=1 (orphaned)
- In my case: 254 orphaned cursor-shell processes
- Each held a PTY, exhausting available PTYs on macOS
How I Confirmed It
-
PTY allocation test failed:
python3 -c 'import pty; pty.openpty()' → OSError: out of pty devices -
Process check showed many cursor-shell instances:
ps -ax -o pid=,ppid=,comm= | awk '$3=="cursor-shell" && $2==1 {print $1}'
Fix (worked immediately)
Kill orphaned cursor-shell processes:
ps -ax -o pid=,ppid=,comm= | awk '$3=="cursor-shell" && $2==1 {print $1}' | xargs -n 50 kill
After cleanup:
- cursor-shell count dropped to 0
- PTY allocation worked again:
python3 -c 'import pty; m,s=pty.openpty(); print("openpty ok", m, s)' pnpm devcould start normally again
Notes
- This appears to be a Cursor terminal process leak, not a project code issue.
- Restarting Cursor helps, but once PTYs are exhausted, killing orphaned cursor-shell processes is the reliable recovery step.
- Reference doc for related terminal failures: VS Code terminal launch troubleshooting
Where does the bug appear (feature/product)?
- Cursor IDE
- Terminal
Steps to Reproduce
So far, since deleting the open processes, I haven’t seen the issue again, but worried there might be run-away processes left behind.
Expected Behavior
No run-away cursor-shell processes to avoid the issue.
Operating System
MacOS Tahoe
Version Information
Version: 2.6.0-pre.42.patch.0
VSCode Version: 1.105.1
Commit: be8e0b780ec172c1c627782307ab8c09c439d2d0
Date: 2026-02-26T00:18:18.482Z (8 hrs ago)
Build Type: Stable
Release Track: Nightly
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0
Does this stop you from using Cursor?
No - Cursor works, but with this issue prevents me from starting my applications without deleting the run-away cursor-shell processes.