How to Fix Cursor Agent Not Using Default zsh Shell on macOS?

I’m encountering an issue while using the Cursor Agent in my development environment on macOS. My default shell is set to zsh (configured with oh-my-zsh), but the Agent seems to be executing commands in a different shell.

As a result, commands like node and python, which are installed on my system and work perfectly fine in my terminal, fail to execute with the error: command not found.

I’ve double-checked my configurations, and the default shell for my system is indeed zsh.

Does anyone know how to ensure the Cursor Agent uses the default zsh shell for executing commands? Any help would be greatly appreciated!

5 Likes

Can you please move this discussion to ‘How To’?

1 Like

I’m facing the same issue. It cannot find any command even though I can find it through the regular VS Code terminal.

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit Use zsh as the default shell on your Mac - Apple Support.
Tushars-MacBook-Pro:ctf tusharchopra$ pnpm dlx shadcn-ui@latest add select
bash: pnpm: command not found
Tushars-MacBook-Pro:ctf tusharchopra$ npm install -g pnpm
bash: npm: command not found

I was facing the same issue. I installed fish-terminal, and all of a sudden Cursor started using fish. I uninstalled fish, and now it’s defaulting to bash, and still is not using zsh.

In my settings.json file, I have "terminal.integrated.defaultProfile.osx": "zsh", and the issue remains.


I ask the agent to run a simple “ls” command and pop out the terminal. This is the process and terminal information.

(text in the photo transcribed)

ls

Process ID (PID): 20547

Command line: /opt/homebrew/bin/bash '--init-file' '/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh'

Shell integration activated

The following extensions have contributed to this terminal's environment:

* Git : Enables the following features: git auth provider

* Python : Activated environment for ./.venv/bin/python

Show Environment Contributions

My settings.json
“terminal.integrated.defaultProfile.linux”: “zsh”,
“terminal.integrated.defaultProfile.osx”: “zsh”,
“terminal.integrated.shellIntegration.enabled”: false,

by adding “terminal.integrated.shellIntegration.enabled”: false, in settings.json resolve the issue for me

8 Likes

YOU saved my life. I’d been looking for ages…

1 Like