Notes
While revisiting my terminal setup, I ran into an issue where commands wouldn't run in Cursor, so I’m recording the cause and fix.
Symptoms
The Cursor terminal opens and displays normally, but when the AI agent tries to execute a command, nothing runs and it hangs.
Cause
The issue appeared after switching the prompt from starship to powerlevel10k. I haven't confirmed it, but Zellij might also be involved.
There is also a topic about this on the Cursor forum.
Solution
The Cursor topic lists several approaches. Here is the configuration that works in my environment at the moment.
It might include unnecessary settings; I haven't fully verified.
Since the cause seems to be powerlevel10k being enabled, I make sure powerlevel10k is not loaded when the Cursor AI agent runs commands by adding the following to my zsh config.
1POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true2if [[ -n $CURSOR_TRACE_ID ]]; then3ZSH_THEME=""4else5ZSH_THEME="powerlevel10k/powerlevel10k"6fi78if [[ -n $CURSOR_TRACE_ID ]]; then9PROMPT='%n@%m:%~%# '10RPROMPT=""11else12[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh13source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme14fi
I use the CURSOR_TRACE_ID environment variable to detect whether the command is being run by Cursor's AI agent.
${pkgs.zsh-powerlevel10k} points to the package path because I manage my config with Nix, but you should adjust this to your environment.