Agent is unable to run any commands. I tried many different approaches and went through the Cursor forum, but nothing worked. I spent around three hours trying to fix this, but had no success. I also tried enabling the legacy terminal tool and tweaking several other settings, but still no luck.
Steps to Reproduce
I just did a fresh install of Cursor, and it’s not working without changing any settings.
Hey, thanks for the report. I’ll need a bit more info to understand the issue for sure:
What exact error do you see when the agent tries to run the command? A screenshot of the agent terminal output would help a lot.
Which shell are you using, zsh, bash, or fish?
You mentioned you tried the Legacy Terminal Tool. Did you also switch Auto-Run Mode? Open Cursor Settings Cmd+Shift+J > Agents > Auto-Run Mode > set Ask Every Time instead of Run in Sandbox. This fully disables the sandbox, and commands will ask for confirmation before running.
This looks like a known macOS sandbox issue. Similar cases were fixed with this workaround:
I’m using Fish, but it seems that when it uses sandbox-exec, it tries to run bin/zsh, which causes this issue:
sandbox-exec: execvp() of ‘bin/zsh’ failed: No such file or directory
It still doesn’t work even without sandbox-exec. I literally tried toggling many things in the agent settings and even set it to ask every time but I still haven’t had any luck.
I found a workaround by adding SHELL=/bin/zsh to the realpath $(which cursor) file but to make it work with zsh, I also had to configure the zsh shell paths, since I’ve been using the fish shell from day one.