Agent shell not working

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Shell commands executed through Cursor’s terminal tool are failing with syntax errors related to bash evaluation, even when using clean environments.

Error Details

Error Message

--: eval: line 17: unexpected EOF while looking for matching `)'
--: eval: line 18: syntax error: unexpected end of file
--: line 1: dump_bash_state: command not found

Reproduction Steps

  1. Execute any command through Cursor’s run_terminal_cmd tool
  2. Error occurs regardless of command complexity
  3. Error persists even with:
    • env -i /bin/bash -c 'echo "test"'
    • sh -c 'echo "test"'
    • Simple commands like docker --version

Investigation Results

  • User’s ~/.bashrc is syntactically correct (no issues found)
  • Error occurs even when bypassing user’s bash configuration
  • Error suggests issue with Cursor’s shell wrapper/execution environment
  • The dump_bash_state command is not defined in any user configuration files

Expected Behavior

Commands should execute normally through Cursor’s terminal integration.

Actual Behavior

All commands fail immediately with the above error messages.

Files Checked

  • /home/ubuntu/.bashrc - No syntax errors found
  • /home/ubuntu/.bash_profile - Standard configuration
  • /etc/bash.bashrc - Standard system configuration
  • No references to dump_bash_state found in user or system configs

Suggested Fix

The issue appears to be in Cursor’s shell execution wrapper, not in user configuration. The dump_bash_state function or command appears to be referenced but not properly defined or loaded.

Steps to Reproduce

This is my Cursor version:

Version: 2.0.54
VSCode Version: 1.99.3
Commit: 7a31bffd467aa2d9adfda69076eb924e9062cb20
Date: 2025-11-03T22:40:44.657Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 23.6.0

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.54
VSCode Version: 1.99.3
Commit: 7a31bffd467aa2d9adfda69076eb924e9062cb20
Date: 2025-11-03T22:40:44.657Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 23.6.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. This looks like a regression of an issue that was fixed in 1.6.35.

The same error (“dump_bash_state: command not found”) was reported and resolved in September: Agent's terminal commands fail with dump_bash_state not found

To understand why it resurfaced in 2.0.54, please share:

  • Are you working in a local workspace or over remote/SSH?
  • Do you have any extensions that might affect terminal behavior?
  • Any console errors? (Help > Toggle Developer Tools > Console tab when it occurs)

Try enabling the Legacy Terminal Tool:

  • Open Cursor Settings Cmd+Shift+J
  • Go to Agents tab → Inline Editing & Terminal
  • Enable “Legacy Terminal Tool”
  • Press Cmd+Shift+P → “Terminal: Kill All Terminals”
  • Fully restart Cursor

I’ll pass this to the team. Let me know if you can provide those details.

Hi,

I am now unable to reproduce the problem. I was working in an EC2 VM over SSH, but since have both restarted the VM and restarted Cursor. I don’t believe it was an issue with an extension, but possibly an issue with my ~/.bashrc.

Best,

Matthew

I am seeing the same issue with the following version of cursor:
Version: 2.0.63

VSCode Version: 1.99.3

Commit: 505046dcfad2acda3d066e32b7cd8b6e2dc1fdc0

Date: 2025-11-05T18:56:58.213Z (6 hrs ago)

Electron: 37.7.0

Chromium: 138.0.7204.251

Node.js: 22.20.0

V8: 13.8.258.32-electron.0

OS: Darwin arm64 25.1.0

I am seeing the same issue as well, even on commands as simple as echo “hello”.

Version: 2.0.69
VSCode Version: 1.99.3
Commit: 63fcac100bd5d5749f2a98aa47d65f6eca61db30
Date: 2025-11-07T18:21:29.650Z (8 hrs ago)
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.0.0

remote ssh extension from cursor has version 1.0.34
while it doesn’t block me functionally, could this be suppressed?

Actually, found a fix

dump_bash_state is the Cursor server’s extensionHostProcess.js bash snapshot helper, which is defined inline.

I had exec zsh in my .bashrc for convenience but this prevented it from defining it.