In the Cursor IDE and CLI, when the agent tries to run a command, all commands fail

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

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.

Expected Behavior

Agent should be able to run commands.

Operating System

MacOS

Version Information

Version: 2.4.37
VSCode Version: 1.105.1
Commit: 7b9c34466f5c119e93c3e654bb80fe9306b6cc70
Date: 2026-02-12T23:15:35.107Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.3.0

For AI issues: which model did you use?

All models

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. I’ll need a bit more info to understand the issue for sure:

  1. 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.
  2. Which shell are you using, zsh, bash, or fish?
  3. 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:

If disabling the sandbox still doesn’t help, please send the exact error text and we’ll dig deeper.

Here is the screenshot:

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.

Let me know if you need any other details.

I have the exact same issue on two Macbooks.

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.

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