Agent Terminal not working

This bug you are referring to is an old one. This is a new bug that appeared just recently within the past few days.

If yours is like mine, it defaults to “null”

If you’re using WSL and need this fixed there’s 2 workarounds

  1. Rename project directory and open cursor fresh on the new one

  2. In a Windows terminal / PowerShell:

    wsl
    
    

    Then inside WSL:

    rm -rf ~/.vscode-server
    logout
    
    

    Back on Windows side:

    wsl --shutdown
    

You then just reopen Cursor and the terminal should be working again(until the context/settings gets corrupt again)

Removing the VS Code Powershell extension resolved my problem.

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I ask cursor (Composer 1 but happens on all) to “Show me the ouput of pwd” and it comes back with:

The terminal isn’t returning command output—only the command text.
The terminal tool appears to have an issue capturing stdout. Should I try a different command or investigate further?

I’ve been having this issue for 2 days now, before, it used to be able to run my tests and keep working through fixes until they ran.

Request ID: 861b53f1-e589-4077-9574-edf8c17ccadd

I mentioned this in another post relating to the issue lots of users are having about needing to accept all changes, that issue is now resolved (enable external file editing) but this issue remains.

Steps to Reproduce

As cursor to show the output of pwd

Expected Behavior

It to return the command output

Screenshots / Screen Recordings

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

For AI issues: which model did you use?

Composer 1

For AI issues: add Request ID with privacy disabled

861b53f1-e589-4077-9574-edf8c17ccadd

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

Agent Failed run any command

Steps to Reproduce

any command

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

me too

Where does the bug appear (feature/product)?

Cursor IDE: AI Pane

Describe the Bug

Any agent failes to run any command; before: showed sth like “your message is too long” in new agent chats with only about 8 lines of prompt input; also asked for “accept” at each new code input during the chat.

BUT: ACCESSING THE SAME WORKSPACE FROM DIFFERENT COMPUTER WITH OTHER CURSOR CLIENT (Linux.deb x64) WORKS FLAWLESSLY.

Therefore i suppose some sort of agent related cache or memory overflow of the cursor client. - I am happy to provide further information using the Developer Tools if you point me in the right direction.

Steps to Reproduce

  • “new chat” - prompt anything that needs terminal or shell interaction of the agent.
  • ”Legacy Terminal Tool” on or off does not solve the problem.
  • Installing 2.0.x Cursor (without complete prio uninstall of 2.1.50) does not solve, either
  • Killing als cursor-server processes in wsl2: ubuntu and Win11 (restart) also does not solve the problem.

Operating System

Windows 11 –> WSL2: ubuntu

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

UPDATE: Using Git-Bash is a successful workaround for me.

Another addition to the thread:**

Issue:** Terminal output capture not working — commands execute successfully (exit code 0) but only the command itself is shown in output, not the actual command results.

Terminal Profile Used:

  • Tested with multiple profiles:

  • Windows PowerShell (default)

  • PowerShell (PowerShell Core)

  • Command Prompt (cmd.exe)

  • Issue occurs with all profiles

Environment:

  • OS: Windows 10 (10.0.26100)

  • Running: Locally (not WSL/Remote)

  • Cursor Version: [Please fill in your Cursor version]

Steps Taken:

  1. Enabled “Legacy Terminal Tool” in Settings → Agents → Inline Editing & Terminal

  2. Killed all terminals (Ctrl+Shift+P → “Terminal: Kill All Terminals”)

  3. Restarted Cursor

  4. Tested with default terminal settings (all custom settings removed)

  5. Issue persists after all steps

Commands Tested:

  • Get-Location (PowerShell)

  • Write-Host “Test output message” (PowerShell)

  • echo Test output (PowerShell/CMD)

  • dir (CMD)

  • cd (CMD)

  • $PWD (PowerShell)

Results:

  • All commands execute successfully (exit code 0)

  • Output only shows the command itself, not the actual output

  • Example: Running Get-Location shows Get-Location in output instead of the current directory path

Settings Tested:

  • Legacy Terminal Tool: Enabled (after following forum instructions)

  • Default Profile: Tested Windows PowerShell, PowerShell, and Command Prompt

  • All other terminal settings: Reset to defaults

Request ID: a36d22a8-2cbc-4076-916b-15331bf7189b

I know this is probably out of Cursor’s control, but what are the chances you could ask Open AI to extend the free trial on Codex Max due to the issues with users on Windows?

Anyone solved this? I’m stuck in this. All command run failed in WSL2

Same here. Terminal commands on WSL are being rejected or simply fail.

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Actual Behavior
The agent’s shell commands return empty output. Investigating the terminal state files shows:

pid: -1
cwd: (empty)
active_command: echo “test” && pwd
Earlier in the session, an error was observed:

Working Directory: /mnt/c/Program Files/cursor/\home\james\hub-dev
ERROR: spawn /usr/bin/bash ENOENT
The working directory is a hybrid path mixing:

Windows path: /mnt/c/Program Files/cursor/
WSL path with wrong slashes: \home\james\hub-dev
This invalid path causes /usr/bin/bash to not be found.

Key Observations
Integrated terminal works - Opening terminal with Ctrl+` correctly spawns bash in WSL
Agent shell does not work - The background shell used by AI agents fails to spawn
Path confusion - The agent shell appears to use a hybrid Windows/WSL path that doesn’t exist
pid: -1 - The shell process never starts (pid should be a positive integer)
Workarounds Attempted (Did Not Fix Agent Shell)
Set terminal.integrated.defaultProfile.linux to “bash”
Set terminal.integrated.defaultProfile.windows to WSL profile
Added explicit bash path in terminal.integrated.profiles.linux
Set remote.WSL.useShellEnvironment to true
Restarted Cursor multiple times
Reloaded window
These settings fixed the integrated terminal (which was defaulting to PowerShell) but did not fix the agent’s background shell.

Workspace Settings Used
{
“folders”: [{ “path”: “.” }],
“settings”: {
“terminal.integrated.defaultProfile.linux”: “bash”,
“terminal.integrated.defaultProfile.windows”: “Ubuntu-24.04 (WSL)”,
“terminal.integrated.profiles.linux”: {
“bash”: {
“path”: “/bin/bash”,
“icon”: “terminal-bash”
}
},
“terminal.integrated.profiles.windows”: {
“Ubuntu-24.04 (WSL)”: {
“path”: “wsl.exe”,
“args”: [“-d”, “Ubuntu-24.04”],
“icon”: “terminal-linux”
}
},
“remote.WSL.useShellEnvironment”: true
}
}
Suspected Root Cause
The agent’s background shell spawning code appears to:

Incorrectly construct the working directory path (mixing Windows and WSL paths)
Not properly detect that it’s in a WSL remote context
Use a different code path than the integrated terminal (which works correctly)
Impact
AI agents cannot execute any shell commands in WSL workspaces
This breaks workflows that require running tests, builds, git commands, etc.
Severely limits agent functionality in WSL development environments
Additional Context
Multiple WSL distributions installed (Ubuntu and Ubuntu-24.04)
Workspace opened via pinned taskbar shortcut (WSL path)
Issue persists across Cursor restarts
Issue appeared after opening workspace via different path formats (Windows Explorer vs WSL terminal)
Suggested Fix
The agent shell spawning code should:

Detect WSL remote context correctly
Use pure Linux paths when in WSL (e.g., /home/james/hub-dev, not hybrid paths)
Spawn /bin/bash from the correct WSL context
Use the same shell spawning logic as the working integrated terminal

Steps to Reproduce

Open a workspace in WSL (e.g., cd /home/user/project && cursor . or open .code-workspace file)
Verify the workspace is connected to WSL (bottom-left shows “WSL: Ubuntu-24.04”)
Open the integrated terminal - it works correctly with bash
Ask the AI agent to run any shell command (e.g., “run pwd”)
Observe that the command fails silently with no output

Expected Behavior

The AI agent should be able to execute shell commands in the WSL environment, just like the integrated terminal can.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Agent Shell Fails to Spawn in WSL Workspace

Summary

The AI agent’s background shell fails to spawn when working in a WSL (Windows Subsystem for Linux) workspace. The regular integrated terminal works correctly, but the shell used by AI agents (for running commands) does not function.

Environment

  • OS: Windows 11 with WSL2
  • WSL Distribution: Ubuntu-24.04
  • Cursor Version: [Check Help → About]
  • Workspace: Opened via WSL Remote (hub-dev.code-workspace)

Steps to Reproduce

  1. Open a workspace in WSL (e.g., cd /home/user/project && cursor . or open .code-workspace file)
  2. Verify the workspace is connected to WSL (bottom-left shows “WSL: Ubuntu-24.04”)
  3. Open the integrated terminal - it works correctly with bash
  4. Ask the AI agent to run any shell command (e.g., “run pwd”)
  5. Observe that the command fails silently with no output

Expected Behavior

The AI agent should be able to execute shell commands in the WSL environment, just like the integrated terminal can.

Actual Behavior

The agent’s shell commands return empty output. Investigating the terminal state files shows:

pid: -1
cwd: (empty)
active_command: echo "test" && pwd

Earlier in the session, an error was observed:

Working Directory: /mnt/c/Program Files/cursor/\home\james\hub-dev
ERROR: spawn /usr/bin/bash ENOENT

The working directory is a hybrid path mixing:

  • Windows path: /mnt/c/Program Files/cursor/
  • WSL path with wrong slashes: \home\james\hub-dev

This invalid path causes /usr/bin/bash to not be found.

Key Observations

  1. Integrated terminal works - Opening terminal with Ctrl+` correctly spawns bash in WSL
  2. Agent shell does not work - The background shell used by AI agents fails to spawn
  3. Path confusion - The agent shell appears to use a hybrid Windows/WSL path that doesn’t exist
  4. pid: -1 - The shell process never starts (pid should be a positive integer)

Workarounds Attempted (Did Not Fix Agent Shell)

  • Set terminal.integrated.defaultProfile.linux to “bash”
  • Set terminal.integrated.defaultProfile.windows to WSL profile
  • Added explicit bash path in terminal.integrated.profiles.linux
  • Set remote.WSL.useShellEnvironment to true
  • Restarted Cursor multiple times
  • Reloaded window

These settings fixed the integrated terminal (which was defaulting to PowerShell) but did not fix the agent’s background shell.

Workspace Settings Used

{
  "folders": [{ "path": "." }],
  "settings": {
    "terminal.integrated.defaultProfile.linux": "bash",
    "terminal.integrated.defaultProfile.windows": "Ubuntu-24.04 (WSL)",
    "terminal.integrated.profiles.linux": {
      "bash": {
        "path": "/bin/bash",
        "icon": "terminal-bash"
      }
    },
    "terminal.integrated.profiles.windows": {
      "Ubuntu-24.04 (WSL)": {
        "path": "wsl.exe",
        "args": ["-d", "Ubuntu-24.04"],
        "icon": "terminal-linux"
      }
    },
    "remote.WSL.useShellEnvironment": true
  }
}

Suspected Root Cause

The agent’s background shell spawning code appears to:

  1. Incorrectly construct the working directory path (mixing Windows and WSL paths)
  2. Not properly detect that it’s in a WSL remote context
  3. Use a different code path than the integrated terminal (which works correctly)

Impact

  • AI agents cannot execute any shell commands in WSL workspaces
  • This breaks workflows that require running tests, builds, git commands, etc.
  • Severely limits agent functionality in WSL development environments

Additional Context

  • Multiple WSL distributions installed (Ubuntu and Ubuntu-24.04)
  • Workspace opened via pinned taskbar shortcut (WSL path)
  • Issue persists across Cursor restarts
  • Issue appeared after opening workspace via different path formats (Windows Explorer vs WSL terminal)

Suggested Fix

The agent shell spawning code should:

  1. Detect WSL remote context correctly
  2. Use pure Linux paths when in WSL (e.g., /home/james/hub-dev, not hybrid paths)
  3. Spawn /bin/bash from the correct WSL context
  4. Use the same shell spawning logic as the working integrated terminal

Version: 2.1.50 (system 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

For AI issues: which model did you use?

Opus 4.5, Composer 1

Does this stop you from using Cursor

Yes - Cursor is unusable

+1, uninstalled cursor, cleared everything related to cursor within wsl & within windows, rebooted my computer and reinstalled cursor, worked for 1 command and then stopped working again
now trying to downgrade to previous version, hopefully that works

Thanks, work for me

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Title: Shell tool returns exit code 0 but commands are not actually executed (v2.1.50)
Environment:
Cursor Version: v2.1.50
OS: Windows 10 (10.0.26100)
Shell: PowerShell
Workspace: Multi-root workspace with Japanese characters in path (OneDrive)
Steps to Reproduce:
Open a multi-root workspace with path containing Japanese characters
Use Agent mode Shell tool to run any command (e.g., echo “test”)
Command returns exit code 0 but no output is captured
File creation commands (e.g., New-Item) also report success but files are not created
Expected: Command output should be captured and returned
Actual: Exit code 0 returned, but no output and commands appear to not execute at all
Notes: Was working before v2.1.50 update

Steps to Reproduce

Bug Report Title (英èȘž):

[Bug] Shell tool silently fails - returns exit code 0 but commands not executed (v2.1.50, Windows, Japanese path)

ăŸăŸăŻçŸ­ăïŒš

Shell tool commands not executing after v2.1.50 update on Windows

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Cursor Version: v2.1.50

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

I’m experiencing the same issue, and it seems to be related to what I described here: Agent loses terminal output - #42 by Green .

In my case, the only thing that helps is deleting the entire directory located at
AppData\Roaming\Cursor\User\workspaceStorage, which of course removes the whole chat history.
After deleting the folder, Cursor works for a while, but then the problem eventually returns.

The issue isn’t just about capturing terminal output — the main problem is that Cursor is unable to run tools at all. For example, try building a project: when everything is working, it takes several seconds. But when Cursor is “broken,” it instantly returns a “success” response even though the build never actually starts.

Cursor’s agent is completely unusable now!
I tried with older version and currently with the latest version and I can’t make a single call to any model.
Has the dev team made any progress?

Request ID: 2a212cd2-8556-48f2-a861-b07de7f82f5a

The only way this continues to work is if I select a really OLD conversation from the archive and have that open a terminal - this then reverts to old behaviour but i then have to keep using an older conversation and watch the “context” - but this can get you going again.

@deanrie This is a critical error in Cursor that is stopping our workflow. When will a fix be deployed? We need this resolved ASAP.