Agent not detecting that a command has completed

This solved my issue with power10k + zsh.

Here is a guide:

  1. run
curl -L https://iterm2.com/shell_integration/zsh -o ~/.iterm2_shell_integration.zsh
  1. on your .zshrc add (nano ~/.zshrc)
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"
}
  1. (not sure it’s necessary) In iTerm2 enable shell integration by enabling Load shell integration automatically in Settings > Profiles > General in the Command section
  2. reload configuration
source ~/.zshrc
  1. restart cursor