Terminal hangs due to background process

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

There are a number of bugs and discussions about the terminal hanging. The suggested remedies didn’t work for me, leading me to discover another reason it will hang.

Apparently Cursor is very aggressive at wanting everything to complete before it ends the terminal. I’m using a script to start/stop a background process so the chat agent can test against the running app. This seems like it should be a common pattern. Is there a preferred way to have the agent launch background services? I was using nohup … & to run the command. I isolated it as the consistent cause of the hang (removing it removed the hang).

Fortunately, I found a workaround. The daemon tool is able to spawn a command in such a way that the chat agent does not hang.

Steps to Reproduce

Ask the agent to run a script that starts a long running process in the background. For example:
( sleep 8 & disown ) & disown
This will hang for 8 seconds and then complete.

Expected Behavior

I would expect the chat agent to complete the terminal task and continue and not hang. In the example in the “steps to reproduce”, I would not expect the chat agent to wait for 8 seconds before continuing.

Operating System

Windows 10/11
Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.45 (user setup)
VSCode Version: 1.99.3
Commit: 3ccce8f55d8cca49f6d28b491a844c699b8719a0
Date: 2025-09-22T18:22:38.013Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Thanks for the detailed report!

Could you please update to Cursor 1.7? v1.7 resolved many terminal hanging issues (see here).

If the issue persists after updating, please let us know

IMm still getting the issue consistently with version 1.7.44. It oftne hangs in agent mode and i have to move to a terminal and press enter.

Here is the lst one the agent tried to run and it just sat there unitl i moved it to an external terminal and press enter:
$process = Get-NetTCPConnection -LocalPort 8003 -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -First 1; if ($process) { Stop-Process -Id $process -Force; Write-Host “:white_check_mark: Stopped old service (PID: $process)” -ForegroundColor Green; Start-Sleep -Seconds 2 } else { Write-Host “:information_source: No service running on port 8003” -ForegroundColor Gray }

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.