cursor_snap_ENV_VARS: zsh + dump_zsh_state issue

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

(eval):3: parse error near `cursor_snap_ENV_VARS…’
zsh:1: command not found: dump_zsh_state:

Same issue as reported here (but closed, so I cannot comment it):

MacOS 26.1

Steps to Reproduce

N/A

Expected Behavior

the shell works as usual

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Cursor:
Version: 2.1.50 (Universal)
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: Darwin x64 25.1.0

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. This issue is related to shell initialization in the agent terminal.

A few questions for diagnostics:

  1. Are you working locally or over SSH?
  2. Do you have exec zsh or exec bash in your .zshrc, .zshenv, or .bash_profile?
  3. Are you using iTerm2 with shell integration? (Check for .iterm2_shell_integration.zsh)

Try these fixes:

If you have exec zsh in .bash_profile, add a guard:

if [[ -n "$CURSOR_AGENT" ]]; then
  :
else
  exec zsh
fi

If you’re using iTerm2 integration, try commenting out this line in .zshrc temporarily:

test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

Similar fix: AI Terminal over SSH fails with `dump_bash_state: command not found` and random "command not found" lines

Let me know if this helps.

1 Like