Linux: Agent Shell commands hang indefinitely

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Agent Shell (the chat Shell tool) starts LocalShellStreamExecutor.execute and never completes. The integrated terminal works. Canceling the tool yields rpc.run error=true. Sometimes spawn fails with Aborted. Reproduced on Cursor 3.15.6 and 3.16.17 on Linux (Nix FHS). User auto-run is already insecure_none. Sandbox support is reported false (unshare EPERM, no root-owned bwrap).

Steps to Reproduce

  1. Open Agent chat on Linux.
  2. Ask the agent to run a trivial shell command, for example: echo hello
  3. Watch the Shell tool stay running with no completed output. In cursor.requestTraces.log the execute span starts and never completes.
  4. Optional: cancel the tool and note rpc.run error=true.
  5. Compare with the same command in the integrated terminal, which works.

Expected Behavior

The shell command should start, finish, and return stdout/stderr. The same command already works in the integrated terminal.

Screenshots / Screen Recordings

Operating System

Linux

Version Information

IDE:
Version: 3.15.6 (also reproduced on 3.16.17, then again after pinning back to 3.15.6)
OS: Linux (Nix FHS Cursor package)
Sandbox support detected: false

For AI issues: which model did you use?

Cursor Grok 4.6

For AI issues: add Request ID with privacy disabled

bed657f4-30c5-4c56-94c7-f26625c6149b

Additional Information

Logs:

  • cursor.requestTraces.log: LocalShellStreamExecutor.execute span_started, no span_completed when hanging
  • renderer.log: [ShellExec] Created session on LocalProcess host about every 5 minutes while idle
  • Parallel shells: three sessions created in the same millisecond; execute never completes
  • Sandbox preflight: unshare EPERM; Sandbox support detected: false

Same 3.15.6 process completed shells for hours, then stopped completing. Integrated terminal stays healthy. Do not treat Nix FHS, rtk hooks, or kernel version as proven root cause.

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report. The logs, request ID, and versions help a lot.

This is an issue we’re already tracking. The agent Shell tool can hang when execute starts and never finishes, while the integrated terminal stays healthy. Your signature matches what we’ve seen on other platforms: the execute span starts but span_completed never arrives, and the session hangs after running fine for hours. I can’t share an ETA yet, but I’ll post in the thread once there’s an update.

A couple notes on diagnostics:

  • Sandbox, unshare EPERM, and missing root-owned bwrap are probably not related. With auto-run policy insecure_none, commands run outside the sandbox, so “Sandbox support detected: false” is a separate thing and not the cause of the hang.

Things you can try right now:

  1. Quick unwedge when the session is stuck: Command Palette Cmd+Shift+P or Ctrl+Shift+P then Developer: Restart Extension Host. A full window reload also clears the stuck shell session.
  2. More stable workaround: enable Legacy Terminal Tool in settings and reload the window. This moves the agent shell off the new exec backend, the one that keeps recreating the session every about 5 minutes in your renderer.log. This has helped in similar cases.

If you can, next time the shell hangs, please grab a process sample of the stuck zsh or bash and any child processes under Cursor Helper while it’s stuck. That’ll help confirm your Nix FHS case is the same mechanism as the others.

Let me know if Legacy Terminal or Restart Extension Host keeps the session working.

I’ll try that, will give you a feedback when I have it, would really love to find a workaround/fix, for now I’m stuck in the agent cli, and I very much prefer using the IDE

Sounds good, I’ll wait for your feedback.

If the goal is to get back to the IDE consistently, I’d start with Legacy Terminal Tool first enable it in settings and reload the window. This moves the agent shell off the old exec backend, the same one that recreates the session in your renderer.log about every 5 minutes. In similar cases, this has been the most stable fix. Developer: Restart Extension Host is more of a quick way to unfreeze things in the moment, not a long term solution.

Also, if it hangs again, please grab a process sample of the stuck zsh or bash and its child processes under Cursor Helper. That’ll help confirm your Nix FHS case follows the same pattern as the others.

Let me know how it goes with Legacy Terminal.