[BUG] AI Assistant Terminal Commands Never Auto-Complete
Problem Description
When Cursor’s AI assistant executes terminal commands using the run_terminal_cmd
tool, commands execute successfully and display correct output, but Cursor never automatically detects command completion. Users must manually click the “Skip” button for every command to proceed with the conversation.
Current Broken Process Flow
Cursor AI → run_terminal_cmd → Shell Process → Command Execution
↑ ↓
Manual Skip ←←←← Hangs Here ←←←← Output + New Prompt
What happens:
Command executes successfully
Output displays correctly
New shell prompt appears
Cursor hangs at “Running terminal command…”
User forced to click “Skip” button manually
Expected Process Flow
Cursor AI → run_terminal_cmd → Shell Process → Command Execution
↑ ↓
Auto Continue ←←←← Detects Completion ←←←← Output + New Prompt
Steps to Reproduce
- Start a conversation with Cursor AI assistant
- Ask AI to run any terminal command (e.g., “run echo test”)
- AI calls
run_terminal_cmd
tool - Command executes and shows correct output
- New shell prompt appears normally
Cursor shows “Running terminal command…” indefinitely
- User must manually click “Skip” button to continue
Environment
- OS: macOS 14.5.0 (Darwin 24.5.0)
- Cursor Version: 1.0.0
- Shell: zsh with oh-my-zsh + Powerlevel10k
- Working Directory: Any directory
Test Results
All commands show identical behavior:
Command Type | Example | Output | Prompt Returns | Auto-Complete |
---|---|---|---|---|
Simple echo | echo "test" |
![]() |
![]() |
![]() |
No output | true |
![]() |
![]() |
![]() |
Unicode text | echo "테스트" |
![]() |
![]() |
![]() |
Directory listing | ls -la |
![]() |
![]() |
![]() |
Current path | pwd |
![]() |
![]() |
![]() |
Troubleshooting Attempted
Shell Configuration Changes:
Tested with minimal .zshrc (only PATH export)
Switched default shell to bash
Tested with simple prompt (removed Powerlevel10k)
Added non-interactive shell guards
Environment Variables:
Set TERM=dumb, PS1='$ ', CURSOR_SHELL=1
Modified shell initialization scripts
Result: Problem persists across all configurations
Impact Assessment
- Severity: High - affects all AI terminal interactions
- Frequency: 100% - occurs with every terminal command
- Workaround: Manual “Skip” button click (severely impacts UX)
- Scope: All users using AI assistant terminal features
Technical Analysis
Evidence points to Cursor’s completion detection logic:
- Process execution:
Commands run successfully
- Output handling:
stdout/stderr display correctly
- Process termination:
Commands complete normally
- Shell prompt:
New prompt appears as expected
- Completion detection:
Cursor doesn’t recognize completion
The Problem Zone:
Command Completes → New Prompt Appears → [CURSOR HANGS HERE] → Manual Skip Required
Likely root causes:
- Shell prompt pattern recognition failure
- Process exit status detection bug
- Output stream completion detection issue
- Platform-specific terminal interaction bug
System Context
Terminal Environment:
# Shell: /bin/zsh
# Prompt: Powerlevel10k with git status
~/Desktop/project main !2 ?1 ✔ system Node 19:52:49
Reproduction Video
[If possible, attach a screen recording showing the issue]
Additional Information
- Issue is specific to Cursor AI assistant terminal tool
- External terminal applications work normally
- Problem occurs regardless of command complexity
- No error messages or warnings displayed
- Issue persists across Cursor restarts
Suggested Investigation Areas
- Prompt Detection Logic: Review how Cursor identifies shell prompt completion
- Process Exit Handling: Check process termination signal handling
- Output Buffer Management: Investigate output stream completion detection
- Platform Compatibility: Test terminal interaction on different macOS versions
Current Workaround
Users must manually click the “Skip” button after every terminal command execution to continue the conversation.