Submit a toolSubmit

Cursor Agent terminal hangs with no output. Fix the shell path

If Agent shell commands spin forever while your terminal works, simplify the prompt with CURSOR_AGENT, enable Legacy Terminal Tool, then fully restart Cursor. Short answer: 5 steps. 1) Separate a hang from a sandbox or CI=1 quirk; 2) Skip heavy themes when CURSOR_AGENT is set; 3) Enable Legacy Terminal Tool, kill terminals, fully quit Cursor; 4) If it still hangs, use a plain default shell profile; 5) Collect Request ID and terminal logs if nothing works.

Last updated: · This page is the decision checklist; the tools list for “Fix Cursor Agent when the terminal hangs” is a separate URL.

The problem: If Agent shell commands spin forever while your terminal works, simplify the prompt with CURSOR_AGENT, enable Legacy Terminal Tool, then fully restart Cursor.
Official docs: cursor.com, cursor.com

How do I fix the shell path when the Cursor Agent terminal hangs?

  1. Separate a hang from a sandbox or CI=1 quirk

    If the integrated terminal runs the same command fine but Agent’s Shell tool never finishes (or returns blank output), you have a completion/capture problem—not a missing binary. Sandbox network blocks and `CI=1` behavior changes are different issues (see Cursor’s sandbox docs and the CI=1 note in Agent troubleshooting). Terminal tool docs: https://cursor.com/docs/agent/tools/terminal

  2. Skip heavy themes when CURSOR_AGENT is set

    Powerlevel9k/Powerlevel10k and other fancy prompts can break inline terminal output and completion detection. In `~/.zshrc` / `~/.bashrc`, skip theme init when `CURSOR_AGENT` is set—Cursor documents this exact variable—and fall back to a simple `PS1`. Restart the Agent chat after saving the shell config.

  3. Enable Legacy Terminal Tool, kill terminals, fully quit Cursor

    Open Cursor Settings → Agents → Inline Editing & Terminal (wording may say Terminal & Editing) and enable Legacy Terminal Tool. Run Command Palette → Terminal: Kill All Terminals, then fully quit Cursor (Cmd+Q / Exit—not only Reload Window; on Windows check Task Manager for leftover Cursor processes) and reopen. Cursor staff recommend this when the newer shell bootstrap handshake never finishes.

  4. If it still hangs, use a plain default shell profile

    Point `terminal.integrated.defaultProfile.*` at a plain bash/zsh/pwsh outside wrappers that break the fd handshake (Nix FHS wrappers are a known case). Temporarily rename a heavy `~/.zshrc` to test, and disable extensions with `cursor --disable-extensions` if a plugin interferes. Unwedge a stuck session with Developer: Restart Extension Host.

  5. Collect Request ID and terminal logs if nothing works

    Copy the chat Request ID, note OS/shell/Cursor version from Help → About, and grab View → Output → Terminal (and Shell Integration if listed). Report on the Cursor forum with those details. Related Agent troubleshooting: https://cursor.com/help/troubleshooting/agent-issues

Which tools are best to fix Cursor Agent when the terminal hangs?

Agent terminal

CURSOR_AGENT env var and theme/prompt troubleshooting for Agent shell output.

Agent troubleshooting

CI=1 behavior, Request ID reporting, and related Agent failure modes.

Terminal help

Help-center terminal overview tied to Agent command running and sandbox modes.

Cursor forum (Legacy Terminal Tool)

Cursor staff guidance: Legacy Terminal Tool + full restart when the shell handshake never finishes.

All tools for “Fix Cursor Agent when the terminal hangs” →

Related fixes

See also AI tools launched today on the daily board.