--: line 1: dump_bash_state: command not found

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Every command ends in

--: line 1: dump_bash_state: command not found

Steps to Reproduce

Happens on every command any agent executes.

Expected Behavior

No error message.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Terminal: Git Bash
Version: 2.1.39 (user setup)
VSCode Version: 1.105.1
Commit: 60d42bed27e5775c43ec0428d8c653c49e58e260
Date: 2025-11-27T02:30:49.286Z
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

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Hey, thanks for the report.

This matches a known issue with agent terminal initialization.

Quick things to try:

  1. Settings → Agents → Inline Editing & Terminal → enable “Legacy Terminal Tool”, then Command Palette → “Terminal: Kill All Terminals” and restart Cursor.
  2. In Git Bash, check your ~/.bashrc for lines like “exec zsh” or others that change shell/environment on non-interactive startup. Remove or limit these lines (only for interactive shells) and test again.

Could you please clarify:

  • Is this a local environment or Remote SSH?
  • Any customizations in ~/.bashrc or ~/.bash_profile?
  • Any errors in Help → Toggle Developer Tools → Console during the issue (screenshots or logs)?

Let me know if enabling Legacy Terminal Tool helps. If not, I’ll escalate this to the engineers.

Clarification:

  1. Local
  2. None.
  3. No errors that occur at same time.

I can now reproduce the issue, if I ask the LLM execute pwd on terminal three times or ask it to execute pwd on terminal 3 times, the issue will occur on the third command executed.

I expect this is the same behaviour for any command.

Thanks for the clarification. Interesting find with the third command - this helps localize the issue.

Your case is very similar to the resolved SSH problem: AI Terminal over SSH fails with `dump_bash_state: command not found` and random "command not found" lines

There, the cause was exec zsh in .bash_profile, which interrupted agent initialization. In your local Git Bash case, something similar might be happening - something in the environment interrupts dump_bash_state after a few commands.

Could you please check:

  • Are there lines like exec, source of other shells, or commands changing the environment in ~/.bashrc or ~/.bash_profile?
  • Does this reproduce with Legacy Terminal Tool enabled (Settings → Agents → Inline Editing & Terminal → “Legacy Terminal Tool”, then Ctrl+Shift+P → “Terminal: Kill All Terminals” and restart Cursor)?
  • Can you record a short video or screenshots of three commands in a row with full terminal output?

Share the info - if the pattern confirms, I’ll pass it to the engineers with details about Git Bash + third command.

1 Like

On a sidenote, is it possible to make Cursor use zsh as its AI terminal?

Thanks for the question about zsh. Agent Mode often ignores terminal profile settings and launches bash or PowerShell (especially on Windows). This is a known issue.

Could you please clarify:

  • Are you using WSL (Ubuntu/Debian etc.) or native Windows with MSYS2/Cygwin/Git for Windows
  • If WSL: which distro (Ubuntu, Debian, other)
  • If native Windows: where is zsh installed (full path to the binary, e.g. C:\msys64\usr\bin\zsh.exe)

What works:

  • You can switch the regular built-in Cursor terminal to zsh via Settings > Terminal > Default Profile or in settings.json:

For WSL:

{
  "terminal.integrated.defaultProfile.windows": "Ubuntu",
  "terminal.integrated.profiles.windows": {
    "Ubuntu": {
      "path": "C:\\Windows\\System32\\wsl.exe",
      "args": ["-d", "Ubuntu"]
    }
  }
}

For MSYS2/Cygwin:

{
  "terminal.integrated.defaultProfile.windows": "zsh",
  "terminal.integrated.profiles.windows": {
    "zsh": {
      "path": "C:\\msys64\\usr\\bin\\zsh.exe",
      "args": ["-l"]
    }
  }
}

What doesn’t work:

  • The AI Agent may ignore these settings and force bash/PowerShell in most cases.

Temporary workaround:

  • Use zsh in the regular terminal, and for Agent commands, temporarily stick with bash/PowerShell.
  • For some users, disabling Shell Integration helps: "terminal.integrated.shellIntegration.enabled": false (but this might break other features).

Let me know these details and I’ll be able to help you.

~/.bashrc and ~/.bash_profile do not exist.

This is not an issue with legacy terminal enabled.

It looks as described:

Note, I did not notice this when changing to v2, some update after v2 introduced this issue.

Thanks, you’ve pinpointed the issue exactly: the third command in a row in Agent Mode with Git Bash on Windows triggers a dump_bash_state error.

This is a regression in the new agent terminal (post v2), specific to Git Bash on Windows.

Could you please share:

Share the Request ID, and I’ll pass it to the engineers with full details for a fix in the new agent terminal.

61402320-827b-4ad0-b3d9-ee91203c50fd

1 Like

Jumping on the wagon here: I’m seeing the same issue on Mac OS with brew-served Bash 5.3.3. I have extensive Bash RC customization, which I’ve largely turned off when it detects that it’s running inside Cursor by checking $CURSOR_TRACE_ID or $VSCODE_GIT_IPC_HANDLE. The customization leaves tools like mise activated, so it can find the right binaries based on the working directory.

It looks like the dump_bash_state shell function gets undefined for some reason. It’s still hard to see where this is happening exactly.

Also experiencing this on windows with NixWSL.

I have many things in my .bashrc to add auto completion for some tools.

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