When using the AI assistant’s terminal tool on macOS with zsh as the default shell, every command execution is followed by a zsh:1: command not found: dump_zsh_state error.
This appears to break the mechanism for terminal session persistence. As a result, each command runs in a new, isolated, and stateless session. The current working directory, environment variables, and any other shell state are reset after every command. This significantly hinders workflows that require a sequence of commands with a shared context.
Steps to Reproduce
Steps to Reproduce:
Set zsh as your default shell on macOS.
Open a project in Cursor and start a chat with the AI assistant.
Ask the assistant to run a command that changes the shell’s state. For example:
export TEST_VAR=“hello” && cd /path/to/your/project && pwd
The command will execute successfully (and show the new path), but it will be followed by the dump_zsh_state error.
Ask the assistant to run a second command to check the state:
echo “Current directory: $(pwd)” && echo “TEST_VAR: $TEST_VAR”
Expected Behavior
Expected Behavior:
The second command should execute in the directory set by the first command (/path/to/your/project).
The echo $TEST_VAR command should print “hello”.
The dump_zsh_state: command not found error should not appear.
Actual Behavior:
The second command executes in the root directory (/), not the project directory.
The echo $TEST_VAR command prints an empty line, as the variable was lost.
The zsh:1: command not found: dump_zsh_state error appears after each command.
Additional Context:
The command dump_zsh_state seems to be an internal helper script or function that Cursor’s AI agent uses to serialize the shell state between run_terminal_cmd tool calls. When this command isn’t found, the state-saving mechanism fails, leading to the stateless behavior.
I’m experiencing the same recurring issue that makes the terminal unusable. I initially thought this error was unique to my setup and was preparing to open a support ticket.
Request: Please escalate this issue.
Additional Information:
Every first terminal command triggers the following parse error:
(eval):3: parse error near `cursor_snap_ENV_VARS…’
zsh:1: command not found: dump_zsh_state
Previously, Cursor Chat used interactive/login shell which loads the default setup script (.bashrc in my case) with all environment variables, aliases and customizations.
Now, it uses non-interactive shell which just loads .profile (it still runs as the current user (OS level) as before).
Previously, Cursor Chat ran terminal from project root or user home dir ~.
My issue is that I cannot input any command on the new agent terminals, so if I need to input a password or a totp for a remote ssh connection i am not able to. I do not get why they remove external terminal for agent executions. This workaround also solves that?
The AI agent and integrated terminal clearly use different shell contexts, with only the agent being affected. This suggests it’s a Cursor-specific issue rather than shell configuration.
Planning to try a clean reinstall next.
Update: reinstalled v1.5.11 and it appears to be working normally (AI agent is in the project dir persistently, and no “dump_zsh_state” errors).
Hope to see it soon, have nearly the same issue. And default terminal is not zsh but bash and I see “dump_bash_state: command not found”. This virtually makes cursor not usable.