Describe the Bug
The run_terminal_cmd tool in Cursor’s AI assistant incorrectly reports command completion for long-running processes before they actually finish executing.
Environment
Cursor Version: 1.3.4
OS: macOS Darwin 24.5.0
Shell: /opt/homebrew/bin/zsh
AI Model: Claude Sonnet 4
Problem Description
When using the run_terminal_cmd tool for long-running commands (especially build commands like ./gradlew build), the tool returns and reports “Command completed” prematurely while the command is still executing in the terminal.
Steps to Reproduce
Use AI assistant with run_terminal_cmd tool
Execute a long-running command like ./gradlew build in a large project
Observe that the tool returns immediately with just the shell prompt
Check actual terminal - command is still running and producing output
Expected Behavior
The run_terminal_cmd tool should:
Wait for the actual command to complete
Return the full command output (compilation logs, test results, etc.)
Only report “Command completed” when the process actually finishes
Show proper exit codes and full output
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.3.4 (Universal)
VSCode Version: 1.99.3
Commit: bfb7c44bcb74430be0a6dd5edf885489879f2a20
Date: 2025-07-29T03:47:21.131Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0
Additional Information
Actual Behavior
The tool:
Returns prematurely with only shell prompt: ➜ my-project git:(feature-branch) ✗
Reports “Command completed” while command is still running
Provides no actual command output or results
Causes AI assistant to incorrectly assume command finished
Evidence/Examples
Working Example (shorter command):
./gradlew :my-app:test --tests “SampleControllerTest”
Returns full output including:
Task :my-app:test
Gradle Test Run :my-app:test
[… full test output …]
BUILD SUCCESSFUL in 5s
Broken Example (long-running command):
./gradlew build
Returns immediately with only:
➜ my-project git:(feature-branch) ✗
(No build output, still running in actual terminal)
Impact
AI assistant makes incorrect assumptions about command completion
May attempt to run subsequent commands while builds are still in progress
Breaks automated workflows that depend on build results
Causes confusion and potential race conditions
Suggested Fix
The run_terminal_cmd tool should properly wait for process completion by:
Monitoring actual process exit status
Collecting complete stdout/stderr output
Only returning when the spawned process actually terminates
Workaround
Currently requires manual verification that commands have actually completed before proceeding with AI assistant recommendations.
Does this stop you from using Cursor
Yes - Cursor is unusable