Cursor Terminal Hanging

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Summary

Cursor terminal commands execute successfully but hang indefinitely waiting for prompt detection, requiring manual Ctrl+C to continue. This makes the AI terminal integration completely unusable.

Steps to Reproduce

  1. Open Cursor in project with Fish shell
  2. Use AI to run ANY terminal command (e.g., echo "test", pwd, git status)
  3. Observe that command executes and outputs correctly
  4. Observe that Cursor never detects completion
  5. Must manually press Ctrl+C

Expected Behavior

  1. AI sends command to terminal
  2. Command executes
  3. Output appears
  4. Cursor detects command completion
  5. Returns control for next command

Actual Behavior

  1. AI sends command to terminal
  2. Command executes successfully :white_check_mark:
  3. Output appears correctly :white_check_mark:
  4. Cursor NEVER detects command completion :cross_mark:
  5. Spinning “Shift+Skip” indicator appears indefinitely
  6. User must press Ctrl+C to continue
  7. Every single command hangs this way

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.7.40
VSCode Version: 1.99.3
Commit: df79b2380cd32922cad03529b0dc0c946c311850
Date: 2025-10-09T02:55:11.735Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.12.51

Additional Information

What We’ve Tried (ALL FAILED)

Fish Shell Configuration Attempts:

  • :white_check_mark: Simplified Fish prompt to minimal >
  • :white_check_mark: Removed all ANSI escape codes
  • :white_check_mark: Disabled git prompt integrations
  • :white_check_mark: Added VSCode shell integration escape sequences (OSC 633)
  • :white_check_mark: Detected TERM_PROGRAM=vscode and used ultra-minimal prompt
  • :white_check_mark: Disabled fish_greeting
  • :white_check_mark: Multiple nixos-config Fish configuration changes

Shell Switching Attempts:

  • :white_check_mark: Tried exec bash to switch to Bash - still hangs
  • :white_check_mark: Tried bash -c "command" - still hangs
  • :white_check_mark: Even Bash commands hang the same way

Project Configuration Attempts:

  • :white_check_mark: Removed all Cursor rules (.cursor/rules/) - no effect
  • :white_check_mark: Verified no .vscode/settings.json interfering

Key Evidence

Commands Execute Successfully:

account-harmony-ai-37599577  gcp-minimal > echo "test"
test

account-harmony-ai-37599577  gcp-minimal > [HANGS HERE - never returns control]

Error Pattern:

  • Command output appears correctly
  • Prompt re-renders
  • But Cursor’s terminal integration never receives “command complete” signal
  • Spinning indicator shows Cursor is still waiting

Timeline:

  • September 17, 2025: Everything working perfectly
    • CI passed
    • Terminal commands worked fine
    • Using nixpkgs version of Cursor
  • September 18, 2025: Terminal completely broken
    • Same Fish configuration
    • Same project setup
    • Suggests a Cursor update caused the issue
  • Troubleshooting Attempt: Created custom Nix flake to install latest Cursor version
  • October 15, 2025: Issue still persisting (nearly 1 month later)
    • Tested with current system configuration
    • All terminal commands continue to hang
    • Problem remains unresolved with both nixpkgs and custom flake installations
    • Confirmed during Chrome browser integration work
    • Issue has been ongoing for 27+ days without resolution

Technical Analysis

Root Cause Hypothesis:

Cursor’s shell integration command completion detection is failing. The mechanism that detects when a command finishes executing is not working with Fish shell (and potentially other shells).

NOT the Problem:

  • :cross_mark: NOT Fish shell prompt complexity
  • :cross_mark: NOT ANSI escape codes
  • :cross_mark: NOT Cursor rules
  • :cross_mark: NOT project configuration
  • :cross_mark: NOT specific to Fish (Bash also fails)

IS the Problem:

  • :white_check_mark: Cursor’s terminal integration cannot detect command completion
  • :white_check_mark: Started after September 17, 2025 (likely a Cursor update)
  • :white_check_mark: Affects ALL commands regardless of shell or configuration

Impact

  • Severity: Critical - Terminal integration completely unusable
  • Workaround: Use external terminal for all commands (defeats purpose of AI integration)
  • Affected Workflow: Any AI-assisted terminal operations

Additional Context

What’s Working:

  • Cursor editor functionality :white_check_mark:
  • AI code generation :white_check_mark:
  • File operations :white_check_mark:
  • Command execution itself :white_check_mark:

What’s Broken:

  • Terminal command completion detection :cross_mark:
  • AI terminal integration :cross_mark:
  • Automated workflows :cross_mark:

System Details:

OS: NixOS Linux 6.12.49
Shell: Fish shell with Starship/Tide prompt
Terminal: Cursor integrated terminal
TERM_PROGRAM: vscode
Cursor Installation Method: NixOS (both nixpkgs and custom flake tested)
Fish Version: [Please add: fish --version]

NixOS-Specific Context:

Suggested Fix

Cursor’s terminal integration should:

  1. Better detect command completion across different shell types
  2. Handle complex prompts (Starship, Tide, etc.) properly
  3. Provide fallback detection mechanism
  4. Add debug logging for shell integration issues

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. There’s a known workaround for terminal command completion detection issues in recent versions.

Try enabling the Legacy Terminal Tool:

  • Go to: Cursor Settings > Chat > Inline Editing & Terminal
  • Enable “Legacy Terminal Tool”
  • Restart Cursor
  • Test terminal commands again

The new terminal tool has regressions with completion detection across different shells. The legacy tool uses the older, more stable terminal integration.

Let me know if enabling the Legacy Terminal Tool helps.

Thanks for the quick reply!

Unfortunately i tried but didn’t work out.

The recent updates (IIRC 1.7.33 or thereabouts) did seem to get the new terminal integration working much better. However, the last day or so, I have had quite a few terminal hangs. So the issues are apparently not fully resolved.

When the terminal has issues like that, it can really drag down velocity as every agent chat has to be babysat to make sure if a terminal hangs, it can be promptly tried again.

The old terminal, IMO, was highly unstable, so I’m a little confused that it is being called the more stable option. My experience has been that it is wildly unstable, hangs almost constantly (and since 1.6.25 it hung on every command until that more recent fix), and was the most problematic feature of Cursor through that point.

The new terminal does seem more stable, more reliable, however it does still have some issues, and it would be great to have a fully and completely stable terminal integration that does not hang or stall.

UPDATE: Detailed Investigation Results

After systematic testing, I’ve asked Cursor to help me give you more context on the problem and tests done. According to Cursor he identified the root cause: Cursor’s shell integration script is not properly signaling command completion back to Cursor’s UI.

Key Findings:

  • Commands execute successfully but hang after completion

  • Issue affects ALL commands, even simple ones

  • Cursor runs bash with shell integration, not the configured fish shell

  • Issue persists even with clean bash shells and automation flags

  • Process shows: bash --init-file /usr/share/cursor/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh

System Details:

  • OS: NixOS 25.11 (Xantusia)

  • Cursor: 1.7.54

  • Shell Integration: Enabled (causing the issue)

Workaround: Disable Shell Integration in Cursor Settings → Terminal → Shell Integration

This appears to be a bug in Cursor’s terminal integration that affects command completion signaling.

Thanks for the info, this will be fixed.

Yes thanks! I’m just updating the thread with my (cursor + sonnet ..) findings - hoping it can help you out! Apparently we have another root cause that was found.. btw it’s very strange this behavoir

UPDATE: Root Cause Identified - Shell Integration Race Condition

After extensive investigation, I’ve identified the root cause: Cursor’s shell integration has a race condition during initialization that causes commands to hang until the integration properly initializes.

Critical Discovery

Commands that were hanging now work perfectly without any configuration changes. The issue resolves itself after:

  • Shell re-initialization
  • Time passes (initialization completes)
  • New shell session spawns

Evidence

Before (Hanging):

  • Shell PID: 6398, PPID: 3858
  • All commands executed but hung after completion
  • Required manual cancellation (^C)

After (Working):

  • Shell PID: 9061, PPID: 3231 (new session)
  • Same commands work perfectly with “Command completed” messages
  • Commands tested: echo, whoami, git status, date - all work

System Information

  • OS: NixOS 25.11 (Xantusia)
  • Cursor Version: 1.7.54
  • Shell: Bash with Cursor shell integration
  • Environment Variables:
    • CURSOR_AGENT=1
    • TERM_PROGRAM=vscode
    • TERM_PROGRAM_VERSION=1.7.54

Shell Integration Details

Cursor runs bash with integration script:

/nix/store/fjkjjrq7377i5g0zabmv228d1kcwgdd3-cursor-1.7.54-extracted/usr/share/cursor/resources/app/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh

Commands Tested (All Affected)

  • echo "test"
  • whoami
  • git status
  • date
  • ps aux | grep fish | head -3
  • cat package.json | head -5

All commands execute successfully and show correct output, but hang during initialization period.

Workarounds Tested (None Fixed Issue)

  • Setting TERM=dumb
  • Setting AUTOMATION=1
  • Using clean bash (bash --norc --noprofile)
  • Unsetting VS Code injection variables

Root Cause Analysis

This is a RACE CONDITION in Cursor’s shell integration initialization:

  1. Shell starts with integration script loading
  2. During initialization period, commands execute but don’t signal completion
  3. After initialization completes (or new shell spawns), commands work perfectly
  4. No configuration changes required - just time/re-initialization

Impact

  • Users must wait for shell integration to initialize OR
  • Users must cancel hanging commands and retry OR
  • Users must restart terminal to get fresh shell session

Recommendation

Fix the shell integration initialization sequence to:

  1. Complete initialization before accepting commands
  2. Properly signal command completion even during initialization
  3. Add timeout/fallback if initialization fails

Reproduction Steps

  1. Open Cursor with integrated terminal
  2. Immediately run any command (e.g., echo "test")
  3. Command executes but hangs without “Command completed”
  4. Wait or spawn new shell session
  5. Same command now works perfectly

This is a timing-dependent bug in the shell integration initialization process.

1 Like

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