Zsh: command not found: q

Describe the Bug

Everytime the agent tries to run a command, there’s always a pause, and when I skip it, I get this error:

q
zsh: command not found: q

Steps to Reproduce

I’m on a MacOS if that matters. I’m just using Agent mode and chatting away and then when it thinks it needs to run a terminal, that’s where I get the issue. That means I always have to skip, and then get that error so that the agent can continue.

Expected Behavior

It should pause and display that error.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.0.0 (Universal)
VSCode Version: 1.96.2
Commit: 53b99ce608cba35127ae3a050c1738a959750860
Date: 2025-06-04T19:21:39.410Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

5 Likes

The same issue, also at version 1.0.0. It’s not agent anymore. I think I am a agent of the cursor agent for click the skip button

1 Like

AI Assistant Terminal Commands Never Auto-Complete · Issue #3215 · getcursor/cursor · GitHub try this, it worked for me

I posted my solution to this in this thread, it appears to work

2 Likes

Same here, but before 1.0.0 update this wasn’t happening. My env: MacOS with zsh shell and oh-my-zsh

Same on Windows (WSL) using zsh - every terminal use by agent ends with a ‘q’

@mwjt42, @alejandroacho, @not-a-real-wolf, @mason105.. try this in your ~/.zshrc

if [[ “$COMPOSER_NO_INTERACTION” != “1” ]]; then
source $ZSH/oh-my-zsh.sh
fi

I noticed that this is set to one in my cursor agent, but not set when using cursor terminal.

So now, I can unset terminal.integrated.defaultProfile.osx to bash and use zsh as default shell.

If you didn’t find a solution yet, you might want to look into this solution by jinkim0823

Here’s a cleaner solution that keeps Powerlevel10k while fixing Cursor Agent detection.

Step 1: Download shell integration

curl -L https://iterm2.com/shell_integration/zsh -o ~/.iterm2_shell_integration.zsh

Step 2: Add to ~/.zshrc (only activates in Cursor Agent):

if [[ -n $CURSOR_TRACE_ID ]]; then
  PROMPT_EOL_MARK=""
  test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
  precmd() { print -Pn "\e]133;D;%?\a" }
  preexec() { print -Pn "\e]133;C;\a" }
fi

Step 3: source ~/.zshrc and restart Cursor

This way you keep your beautiful P10k theme in normal terminal use, but Cursor Agent gets the proper command detection signals. The CURSOR_TRACE_ID check ensures it only affects Cursor sessions.

1 Like

This solution worked for me, thanks for pointing @Jean_SORDES !

1 Like

Interesting, for me $CURSOR_TRACE_ID is still set on Cursor Terminal.