Cursor agent mode - when running terminal commands often hangs up the terminal, requiring a click to pop it out in order to continue commands

Since unfortuantely Cursor is still silent about this issue. Here is what worked for me. Cursor would hang after running terminal commands (especially in Agent Mode), and I’d have to click to pop the terminal out to continue. I’m using Zsh + Powerlevel10k + Nerd Fonts on macOS.

Turns out Cursor seems to be unable to detect when the command finished because the Powerlevel10k prompt is too complex, especially with glyphs and async segments.

:wrench: Solution: Use a minimal prompt inside Cursor only

I fixed it without giving up Powerlevel10k in other terminals (like iTerm2) by:

  1. Detecting if I’m inside Cursor (TERM_PROGRAM == “vscode”).
  2. Disabling the Powerlevel10k theme and prompt in that case.
  3. Falling back to a simple, clean prompt just for Cursor.

:puzzle_piece: Final .zshrc snippet

# Set Oh My Zsh theme conditionally
if [[ "$TERM_PROGRAM" == "vscode" ]]; then
  ZSH_THEME=""  # Disable Powerlevel10k for Cursor
else
  ZSH_THEME="powerlevel10k/powerlevel10k"
fi

# Load Oh My Zsh
source $ZSH/oh-my-zsh.sh

# Use a minimal prompt in Cursor to avoid command detection issues
if [[ "$TERM_PROGRAM" == "vscode" ]]; then
  PROMPT='%n@%m:%~%# '
  RPROMPT=''
else
  [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh
fi

:white_check_mark: After restarting Cursor (exec zsh or close/reopen), it now properly detects command completion — no more hangs, no need to click or pop out the terminal.

:light_bulb: Optional: You can use something like vcs_info to add Git branch info to the minimal prompt if needed.

Hope this helps others facing the same annoying issue!

28 Likes