The Agent terminal tool never returns, even for pwd. The UI stays on Running with no stdout/stderr. I have to press Stop. Cursor’s integrated terminal (Ctrl+`) works normally.
This is not a long-running command problem. pwd should exit immediately.
Steps to Reproduce
Open a local workspace on This Mac (not Cloud Agent)
Start an Agent chat with High Fast
Type pwd
The agent replies, then shows Running Print current working directory with $ pwd
No output appears. The tool stays Running until I stop it
I reproduced this across several chats in the same hour.
Expected Behavior
Expected: pwd prints the cwd and the tool completes in milliseconds
Actual: empty output, infinite Running, Stop button stays active
OS: macOS Darwin 25.6.0
Cursor: 3.18.25 stable (280eca2911f1774689696e5f1efa5a4f97a87af0)
VS Code: 1.128.0
Shell: zsh
Model: High Fast
Agent CLI: 2026.09.02-c22c1a3
When: 2026-09-03 19:45–19:49 CST
For AI issues: which model did you use?
This has nothing to do with the model, but I’m using Grok 4.6 High Fast.
For AI issues: add Request ID with privacy disabled
4e61c7a5-c823-4afa-b0a0-a2a5037b1d6e
Additional Information
~/.zshrc runs this on every non-VSCODE_RESOLVING_ENVIRONMENT shell:
eval “$(~/.local/bin/agent shell-integration zsh)”
A diagnostic that times zsh -il, zsh -i, and agent shell-integration zsh produced no output for 5+ minutes. That looks like a startup deadlock: Agent starts zsh → zshrc calls agent shell-integration → that never returns → pwd never runs.
Related: Guide: Fix Cursor Agent Terminal Hangs Caused by .zshrc. Those reports usually see command output but miss the completion signal. Here there is no output at all.
That integration is meant for an interactive TTY (session recording, please-fix, Tab-to-agent). But the generated script also does this outside the [[ -t 0 ]] guard:
if [[ -z "$CURSOR_RECORD_SESSION" ]]; then
export CURSOR_RECORD_SESSION=1
exec ~/.local/bin/agent record
fi
The IDE Agent Shell tool starts a fresh zsh for every command. That zsh sources .zshrc, which synchronously runs agent shell-integration and can exec agent record. The Agent waits for the shell; the shell calls back into the Agent. Deadlock.
Repro
Run agent install-shell-integration so the eval line is in ~/.zshrc
Open a local workspace (This Mac, not Cloud Agent)
In an Agent chat, run pwd
The tool stays Running with no stdout/stderr until Stop. Sometimes it fails with Command failed to spawn: Aborted
Control: Cursor’s integrated terminal (Ctrl+) works. Only the Agent background shell hangs. pwd` should finish immediately.
Environment: macOS Darwin 25.6.0; Cursor 3.18.25 (280eca2911f1774689696e5f1efa5a4f97a87af0); VS Code 1.128.0; zsh; Agent CLI 2026.09.02-c22c1a3.
Ask
Do not install shell integration on every zsh startup, or skip it in non-TTY / Agent shells (CURSOR_AGENT, COMPOSER_NO_INTERACTION)
Keep exec agent record inside an interactive TTY check
Time out and surface a clear error when Agent shell startup hangs, instead of infinite Running
Local workaround: return early at the top of .zshrc when those Agent env vars are set. The IDE Agent terminal works again; interactive terminals can keep CLI integration.