Title: Agent-started long-running servers (Vite) disappear from the Terminal UI; aborting the agent shell orphans the process (PPID 1)
Where does the bug appear: Cursor IDE (Agent Shell + Terminal panel)
Cursor version: 3.20.17 OS: macOS 15.2 (24C101)
Describe the Bug
When Agent starts a long-running local server (npx vite --host 127.0.0.1 --port 5173) in the background:
Opening View → Terminal only creates a blank new terminal. The Agent’s Vite session is not listed.
Cursor Browser can still load http://127.0.0.1:5173 after the chat shows the shell as aborted.
The Node/Vite process is still alive, reparented to PID 1, with no TTY / no Terminal tab. The user cannot stop it from the Terminal UI. They must ask Agent to kill it, or find the PID with lsof themselves.
This is hostile for daily dev: Agent-owned servers are not first-class, not visible, and not cleaned up.
Steps to Reproduce
In Agent chat, ask Agent to run a Vite/dev server to verify the app in Cursor Browser.
Agent backgrounds npx vite --host 127.0.0.1 --port 5173.
Chat later reports the shell aborted / terminated_by_user.
Open Terminal (`⌃``). Observe only a new empty terminal; no Vite session in the tab list.
Refresh Cursor Browser against 127.0.0.1:5173 — the app still loads.
For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)
For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…
Additional Information
Add any other context about the problem here.
Does this stop you from using Cursor?
Yes - Cursor is unusable
Sometimes - I can sometimes use Cursor
No - Cursor works, but with this issue
The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!
Hey, thanks for the detailed report. There are two separate things here, so I’ll cover them one by one.
Where the Vite terminal lives. In the Agents Window, terminals started by the agent are intentionally not shown in the normal terminal tab list, so View → Terminal opens a new terminal that’s yours. The agent shells are under the N Terminals pill right above the agent input. Click it to see the list of running agent shells. Each one has a Stop button, and clicking a row opens it as a read-only tab. That’s currently the closest thing to the agent processes view you described. It doesn’t show PID or port yet, but I passed your suggestion for that view to the team.
Vite stays alive after Stop. That shouldn’t happen, and I sent it to the team. It looks like Stop does end the shell wrapper, but with some command forms the actual server it started doesn’t get killed with it. To figure out which form you hit, can you help with two things:
In the chat where this happened, expand the tool call that started Vite and paste the exact command line the agent ran, including parts like &, nohup, or > file 2>&1.
Try this in a new chat and tell me what you see:
Ask the agent to run cd <your project> && npx vite --host 127.0.0.1 --port 5173 > /tmp/vite.log 2>&1 in the background and leave it running.
Once the chat shows the command is running in the background, click the 1 Terminal pill above the input.
Hit Stop on the Vite row.
Wait 10 seconds, then in your own terminal run lsof -nP -iTCP:5173 -sTCP:LISTEN.
Repeat steps 1 to 4, but this time ask for cd <your project> && npx vite --host 127.0.0.1 --port 5173 without redirecting output to a file.
Does the listener survive in one case, both, or neither?
Workaround for now: ask the agent to start servers without redirecting output to a file, or explicitly ask it to kill the server when you’re done. That avoids the orphan process. Let me know what the test shows.