# Cursor Terminal Hanging

**URL:** <https://forum.cursor.com/t/cursor-terminal-hanging/137595>\
**Category:** Bug Reports\
**Created:** [October 15, 2025, 8:25pm UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595 "2025-10-15T20:25:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacopone](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jacopone/32/53213_2.png) [@jacopone](https://forum.cursor.com/u/jacopone)\
**Post date:** [October 15, 2025, 8:25pm UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/1 "2025-10-15T20:25:04Z")

</div>

### 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 ✅
3. Output appears correctly ✅
4. **Cursor NEVER detects command completion** ❌
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:

- ✅ Simplified Fish prompt to minimal `> `
- ✅ Removed all ANSI escape codes
- ✅ Disabled git prompt integrations
- ✅ Added VSCode shell integration escape sequences (OSC 633)
- ✅ Detected TERM\_PROGRAM=vscode and used ultra-minimal prompt
- ✅ Disabled fish\_greeting
- ✅ Multiple nixos-config Fish configuration changes

### Shell Switching Attempts:

- ✅ Tried `exec bash` to switch to Bash - still hangs
- ✅ Tried `bash -c "command"` - still hangs
- ✅ Even Bash commands hang the same way

### Project Configuration Attempts:

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

## Key Evidence

### Commands Execute Successfully:

```auto
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
  - Repository: [GitHub - jacopone/code-cursor-nix: Auto-updating Nix package for Cursor AI editor with browser automation (Playwright/Puppeteer/Selenium). Updates 3x/week. Chrome bundled for NixOS testing.](https://github.com/jacopone/code-cursor-nix)
  - **Result** : Issue persists even with latest version
  - This suggests the problem is not specific to the nixpkgs packaging

- **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:

- ❌ NOT Fish shell prompt complexity
- ❌ NOT ANSI escape codes
- ❌ NOT Cursor rules
- ❌ NOT project configuration
- ❌ NOT specific to Fish (Bash also fails)

### IS the Problem:

- ✅ Cursor’s terminal integration cannot detect command completion
- ✅ Started after September 17, 2025 (likely a Cursor update)
- ✅ 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 ✅
- AI code generation ✅
- File operations ✅
- Command execution itself ✅

### What’s Broken:

- Terminal command completion detection ❌
- AI terminal integration ❌
- Automated workflows ❌

### System Details:

```auto
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:

- Running on NixOS with declarative configuration
- Tried TWO different Cursor installations:
  1. Standard nixpkgs Cursor package
  2. Latest version via custom flake: [GitHub - jacopone/code-cursor-nix: Auto-updating Nix package for Cursor AI editor with browser automation (Playwright/Puppeteer/Selenium). Updates 3x/week. Chrome bundled for NixOS testing.](https://github.com/jacopone/code-cursor-nix)

- Issue occurs with BOTH installation methods
- This rules out NixOS packaging as the cause
- Suggests core Cursor terminal integration issue

## 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

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [October 16, 2025, 1:12pm UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/2 "2025-10-16T13:12:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jacopone](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jacopone/32/53213_2.png) [@jacopone](https://forum.cursor.com/u/jacopone)\
**Post date:** [October 17, 2025, 2:11am UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/3 "2025-10-17T02:11:19Z")

</div>

Thanks for the quick reply!

Unfortunately i tried but didn’t work out.

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/e/c/ecbd264d2c18f0e02002c2325b975c021c097f0f.png)

---

<div class="post-metadata">

**Author:** ![jrista](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jrista/32/68794_2.png) [@jrista](https://forum.cursor.com/u/jrista)\
**Post date:** [October 17, 2025, 5:17am UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/4 "2025-10-17T05:17:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jacopone](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jacopone/32/53213_2.png) [@jacopone](https://forum.cursor.com/u/jacopone)\
**Post date:** [October 24, 2025, 7:27pm UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/5 "2025-10-24T19:27:42Z")

</div>

**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.

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [October 25, 2025, 6:15am UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/6 "2025-10-25T06:15:46Z")

</div>

Thanks for the info, this will be fixed.

---

<div class="post-metadata">

**Author:** ![jacopone](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jacopone/32/53213_2.png) [@jacopone](https://forum.cursor.com/u/jacopone)\
**Post date:** [October 25, 2025, 8:37am UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/7 "2025-10-25T08:37:51Z")

</div>

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:

```auto
/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.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [November 16, 2025, 8:38am UTC](https://forum.cursor.com/t/cursor-terminal-hanging/137595/8 "2025-11-16T08:38:15Z")

</div>

Closed on November 16, 2025, 8:38am UTC

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