Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Issue: When agent runs a non-interactive command that occupies a terminal session (like docker run without -d flag), agent cannot distinguish between different terminal sessions and continues sending commands to the occupied session instead of a new or available one.
Apparent Cause: Agent lacks the ability to:
Identify which terminal session is responsive vs occupied
Route subsequent commands to available terminal sessions
Understand that run_terminal_cmd with is_background=false will use the same shell session
Steps to Reproduce
Reproduction Steps:
Run any long-running, non-interactive command (e.g., docker run, tail -f, ping)
Issue instruction, todo, step that will attempt to run additional commands in the same session
Commands will be queued but not executed because the terminal is occupied
Agent will repeatedly attempt to use the same occupied session
Expected Behavior
Agent should either:
Use is_background=true to free the terminal for new commands
Route new commands to available terminal sessions
Have clear visibility into which terminals are responsive
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.5.5
VSCode Version: 1.99.3
Commit: 823f58d4f60b795a6aefb9955933f3a2f0331d70
Date: 2025-08-25T17:40:25.290Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0
For AI issues: which model did you use?
Auto
Gemini 2.5 Pro thinking
Claude sonnet latest thinking
Probably all since command tool seems to be where the observability of the terminal states lives.
Additional Information
Impact: This creates UX where agents appears to ignore instructions and repeatedly fail to execute commands properly. Easily work around it for several months. Figured I’d see it resolved but since I haven’t, thought to share the ‘feature request’. Appreciate all you do.
This is a limitation in the agent terminal management capabilities that affects any long-running process or interactive processes. I see this as an enhancement. Probably already tracked somewhere that I couldn’t find.
Does this stop you from using Cursor
No - Cursor works, but with this issue