Cursor version 2.1.39 has terminal bug

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Describe the Bug / バグの説明

[English]
The AI Agent's Shell tool fails to spawn a proper shell process on Windows. The terminal shows `pid: -1` and all commands return empty output, even though exit code shows 0.

When asking the Agent to run commands like `git status`, `git commit`, or any shell command:
- Exit code returns 0 (appears successful)
- But stdout is always empty
- Terminal file shows `pid: -1` (process not spawned)
- Commands are NOT actually executed

This makes it impossible for the Agent to:
- Execute git operations (commit, push, pull)
- Run build tools or linters
- Execute any shell commands

Evidence from terminal state file:
---
pid: -1
cwd: 
last_command: git status
last_exit_code: 0
---

Note: Regular IDE terminals work fine (pid: 24892, etc.), only Agent-spawned terminals fail.

[日本語]
AIエージェントのシェルツールがWindows環境で正常にシェルプロセスを起動できません。ターミナルには `pid: -1` が表示され、終了コードが0でも全てのコマンド出力が空になります。

`git status`、`git commit` などのコマンドをエージェントに実行させると:
- 終了コードは0(成功に見える)
- しかし標準出力は常に空
- ターミナルファイルには `pid: -1`(プロセス未起動)
- 実際にはコマンドが実行されていない

これにより、エージェントは以下ができません:
- git操作(commit, push, pull)の実行
- ビルドツールやリンターの実行
- あらゆるシェルコマンドの実行

ターミナル状態ファイルの証拠:
---
pid: -1
cwd: 
last_command: git status
last_exit_code: 0
---

注:通常のIDEターミナルは正常動作(pid: 24892など)、エージェントが起動するターミナルのみ失敗します。

Steps to Reproduce

Steps to Reproduce / 再現手順

[English]
1. Open any Git repository workspace on Windows
2. Open Agent chat (Ctrl+L or click Agent)
3. Ask the Agent to run a shell command, e.g.: "Run git status"
4. Observe the result:
   - Exit code: 0
   - Output: empty
   - Check terminals folder: pid: -1

[日本語]
1. Windows環境で任意のGitリポジトリをワークスペースとして開く
2. エージェントチャットを開く(Ctrl+L またはAgentをクリック)
3. エージェントにシェルコマンドの実行を依頼する(例:「git statusを実行して」)
4. 結果を確認:
   - 終了コード:0
   - 出力:空
   - terminalsフォルダを確認:pid: -1

Expected Behavior

Expected Behavior / 期待される動作

[English]
When the Agent executes shell commands:
1. A shell process should spawn with a valid PID
2. Commands should actually execute
3. Command output (stdout/stderr) should be captured and returned
4. Files created by commands (e.g., via redirection) should exist

[日本語]
エージェントがシェルコマンドを実行する際:
1. 有効なPIDを持つシェルプロセスが起動されるべき
2. コマンドが実際に実行されるべき
3. コマンド出力(stdout/stderr)がキャプチャされて返されるべき
4. コマンドで作成されるファイル(リダイレクト等)が存在するべき

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.48 (system setup)
VSCode Version: 1.105.1
Commit: ce371ffbf5e240ca47f4b5f3f20efed084991120
Date: 2025-12-04T19:26:27.263Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

Additional Information

Attempted Workarounds / 試した回避策

# Workaround / 回避策 Result / 結果
1 Reload Window (Developer: Reload Window) / ウィンドウの再読み込み :cross_mark: No effect / 効果なし
2 Full Cursor restart / Cursorの完全再起動 :cross_mark: No effect / 効果なし
3 Enable Legacy Terminal Tool (cursor.chat.useLegacyTerminal: true) :cross_mark: No effect / 効果なし
4 Change default terminal to Command Prompt / デフォルトターミナルをCommand Promptに変更 :cross_mark: No effect / 効果なし
5 Enable PowerShell Legacy ReadLine / PowerShell Legacy ReadLineの有効化 :cross_mark: No effect / 効果なし
6 Use cmd /c prefix for commands / コマンドに cmd /c プレフィックスを使用 :cross_mark: No effect / 効果なし
7 Use background execution (is_background: true) / バックグラウンド実行を使用 :cross_mark: No effect / 効果なし
8 Redirect output to file / 出力をファイルにリダイレクト :cross_mark: File not created / ファイル未作成
9 Change default terminal to Git Bash / デフォルトターミナルをGit Bashに変更 :white_check_mark: SUCCESS! / 成功!

:white_check_mark: Workaround / 回避策

Current Workaround / 現時点での回避策

[English]
Set Git Bash as the default terminal profile for Windows:

  1. Open Settings (Ctrl + ,)
  2. Search for “terminal default profile windows”
  3. Select “Git Bash” from the dropdown
  4. Restart Cursor

Or add these settings to settings.json:

{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.profiles.windows": {
        "Git Bash": {
            "path": "C:\\Program Files\\Git\\bin\\bash.exe",
            "icon": "terminal-bash"
        }
    }
}

Note: This requires Git for Windows to be installed. After applying this workaround, the Agent can successfully execute shell commands including git operations (commit, push, pull).


[日本語]
Git BashをWindowsのデフォルトターミナルプロファイルに設定する:

  1. 設定を開く(Ctrl + ,
  2. “terminal default profile windows” を検索
  3. ドロップダウンから “Git Bash” を選択
  4. Cursorを再起動

または、settings.json に以下の設定を追加:

{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.profiles.windows": {
        "Git Bash": {
            "path": "C:\\Program Files\\Git\\bin\\bash.exe",
            "icon": "terminal-bash"
        }
    }
}

注意: この回避策にはGit for Windowsのインストールが必要です。この回避策を適用後、エージェントはgit操作(commit, push, pull)を含むシェルコマンドを正常に実行できるようになります。


Operating System / オペレーティングシステム

Windows 10/11
(Build 10.0.26100)

Additional Information / 追加情報

[English]
Related issues:
- https://github.com/cursor/cursor/issues/2669
- https://forum.cursor.com/t/agent-shell-tool-fails-to-spawn-shell-process-on-wsl-pid-1/145286
- https://forum.cursor.com/t/windows-dotnet-shell-commands-not-working/138807

Settings applied (no effect):
{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "cursor.chat.useLegacyTerminal": true,
    "powershell.integratedConsole.useLegacyReadLine": true
}

[日本語]
関連するIssue:
- https://github.com/cursor/cursor/issues/2669
- https://forum.cursor.com/t/agent-shell-tool-fails-to-spawn-shell-process-on-wsl-pid-1/145286
- https://forum.cursor.com/t/windows-dotnet-shell-commands-not-working/138807

適用した設定(効果なし):
{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "cursor.chat.useLegacyTerminal": true,
    "powershell.integratedConsole.useLegacyReadLine": true
}

Does this stop you from using Cursor

No - Cursor works, but with this issue

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When ai uses the terminal, it just keep running. Started just after latest update few hours ago. On WSL.

Steps to Reproduce

When ai uses the terminal, it just keep running. Started just after latest update few hours ago. On WSL.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.48 (user setup)
VSCode Version: 1.105.1
Commit: ce371ffbf5e240ca47f4b5f3f20efed084991120
Date: 2025-12-04T19:26:27.263Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Any model, any cmd on terminal including cat, git status anything.

Does this stop you from using Cursor

Yes - Cursor is unusable

2 Likes

@deanrie Why did you my bug to this thread? My issue is new, just started today. Its not 8 days old, it wasn’t with 2.1.39.

If it’s helpful a current workaround, is to run everything in the background. terminals ran in the background succeed. Ones that don’t fail.

I’m on windows ssh’d into linux vm.

1 Like

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Agent cannot read terminal output any more. Agent terminal is now “read only” and displays as “Agent Terminal” instead of “Cursor” - it seems to be locked into using bash only - and cannot read any output. This makes it unusable. Asking something really simple like “list a directory” and it is now totally incapable of doing - this has changed today. Literally, today.

Steps to Reproduce

Open Cursor. New Agent Ask it to list a directory and click the “open terminal” link on the command output in the agent reply. Watch it fail to read any terminal output.

Expected Behavior

Should be able to read what is happening in it’s own terminal.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.48 (user setup)
VSCode Version: 1.105.1
Commit: ce371ffbf5e240ca47f4b5f3f20efed084991120
Date: 2025-12-04T19:26:27.263Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.22631

For AI issues: which model did you use?

Composer-1

Does this stop you from using Cursor

Yes - Cursor is unusable

I already tried turning “Legacy terminal” option on - this has made zero difference.

1 Like

I went back to an OLD agent… it was able to open the “old style terminal” and thus is able to read output from the terminal again - note it is called “Cursor” - above it is a New Agent. This agent is in an “Agent Terminal” and cannot read any terminal output at all - also it seems stuck in bash and nothing I seem to do changes this.

You are my hero. This is the only workaround that has worked for me.

1 Like

Same, It was doing that on windows 11 powershell, so I switched to cursor in WSL but the terminal was still not working and then I added this cursor rule : “For all terminal/tool commands, always set working_directory to the project root.”
and the terminal output works but now half the time cursor doesn’t wait for the terminal response and moves on to a new command :sob: Cursor pls fix this

That’s awesome bro thanks for helping people all over the world :heart_eyes:

1 Like

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Windows version: Windows 11 build 26200

Cursor version: (from Help → About)

Shell integration: Enabled

Issue: Commands execute (exit code 0) but produce no output.

Terminal files: Show pid: -1 and empty cwd:.

Tried: Restarts, cache clears, new terminals, full PC restart — all failed.

Steps to Reproduce

Ask the AI (Specifically sonnet 4.5) to run a terminal command it should just run the command with no output underneath

Expected Behavior

Expected: Shell tool should spawn a valid process, produce output, and update terminal files. Actual: Shell tool reports success but does not execute anything; no output is visible to AI.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.49 (user setup)
VSCode Version: 1.105.1
Commit: 21a2ed198584d56a91c0b996d1a09c93f8538440
Date: 2025-12-05T07:49:06.016Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor agent is no longer able to run terminal commands. It runs something, but it’s no longer able to do stuff like build a nextjs app, spin up the dev server, or commit to Github.

Steps to Reproduce

I ask it to spin up the dev server for an app and it’s unable.

Expected Behavior

It used to be able to run terminal commands. This is a pretty major break.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.50 (user setup)
VSCode Version: 1.105.1
Commit: 56f0a83df8e9eb48585fcc4858a9440db4cc7770
Date: 2025-12-06T23:39:52.834Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

Yes - Cursor is unusable

3 Likes

Per the Agent:

Bug Report: Terminal Tool Output Not Captured

Issue: Agent terminal tool executes commands but displays no output.

Environment:

  • OS: Windows 11
  • Shell: PowerShell
  • Cursor version: [your version]

Steps to Reproduce:

  1. Run any PowerShell command via agent terminal tool (e.g., Write-Host "test", Get-Location)
  2. Command executes (exit code 0)
  3. No output is displayed

Expected: Commands display their output.

Actual: Commands execute silently with no output visible.

Additional Notes:

  • Agent terminal shows prompt • $ instead of standard PS C:\path>
  • Manual terminals (Ctrl+Shift+`) work correctly
  • “Legacy Terminal Tool” disabled — no change
  • PowerShell extension installed — no change
  • Affects all command types

Impact: Agent terminal tool is unusable for tasks requiring output verification.

Workaround: Use manual terminals which work correctly.

Root Cause: Agent terminal tool appears to have broken output capture mechanism, separate from regular terminal integration.

1 Like

I am also having this exact same issue. All commands exit code 0 but return no output, I had it do a sleep command and it instantly returned 0 so it seems like its not executing the commands at all.

2 Likes

I’ve been having the same problem for two days. Previously, when I issued a command to compile, check, and then run the code, the final version of my application would appear on the screen. Now it doesn’t, and if there’s an old application in the folder, it doesn’t overwrite it. It just says “compile completed, your file has been opened, check the changes.”

I am facing the same issue: check if this solves your problem. the recommended fix didn’t solve my bug:
Agent Shell tool fails to spawn shell process on WSL (pid: -1) - Bug Reports - Cursor - Community Forum

Roll back to 2.0.77, found this bug 2 weeks ago

I am also seeing the issue in Cursor 2.1.49. My current workaround is to add the following to my general rules with alwaysApply: true

PowerShell Output Retrieval

After executing run_terminal_cmd, immediately read the corresponding terminal file (terminals/{id}.txt) to retrieve complete command output. Use offset parameter to skip to recent lines if the file is large.

How can I rollback versions? I only see a download for 2.1, nothing about minor versions.

Same here on latest version 2.1.50. Cursor, can you test things are stable before you release your stupid broken features that break all the essential features?

1 Like