Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
lsof -ti:8080 | xargs kill -9 2>/dev/null; lsof -ti:3000 | xargs kill -9 2>/dev/null; echo “ports freed”
Agent is waiting for a command to finish.
Steps to Reproduce
Let agent kills the local server both frontend and backend.
Expected Behavior
Kill and receive immediately.
Do not waste my too many requests / quota!
Operating System
MacOS
Version Information
Version: 3.1.17
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.4.0
For AI issues: which model did you use?
Opus 4.6 - non thinking
Does this stop you from using Cursor
Yes - Cursor is unusable
Hi @zhaoxi2000,
This is a known issue with the agent’s terminal command completion detection. When commands kill processes (like lsof | xargs kill -9), the killed processes can hold file descriptors that delay the signal the agent relies on to know the command finished. The agent then gets stuck waiting even though the command already completed.
A couple of things you can try:
-
Cancel and continue – if the agent gets stuck waiting, click Cancel. The agent should proceed immediately with the output that was already returned
-
Run port-killing commands in a separate terminal – rather than having the agent run lsof | xargs kill -9, run those commands yourself in a regular terminal and let the agent focus on code tasks
Our team is aware of this issue. You may also find this related thread helpful, where other users have reported the same class of issue with detailed analysis.