Cursor CLI headless mode does not release the terminal

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

When I run

cursor-agent -p "<cmd>"

even with the -p (print) flag, the process doesn’t release the terminal. I still need to press CTRL+C on macOS to get back control and type new commands.

Is there a way to fix this, or some configuration I can change so the CLI exits cleanly in headless/non-interactive mode?

Steps to Reproduce

Run

cursor-agent -p "<prompt>" && echo "i'm here"

Expected Behavior

i’m here is printed out.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

cursor-agent --version => Version: 2025.09.12-4852336

Does this stop you from using Cursor

No - Cursor works, but with this issue

3 Likes

Given the situation I observe, the only workaround I see is to kill the process after a timeout.

hi @ThomSMG thank you for the bug report, we are looking into it.

Hi! Meanwhile `2025.09.18-7ae6800` has been released, but I don’t find the problem addressed yet.

It is really painful. @condor can Cursor team please prioritize on this? It makes the execution of CI/CD pipeline difficult. Currently, I have to force kill the process.

1 Like

After an update to 2025.09.18-7ae6800 it is solved for me. Thanks team!

1 Like

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