iTerm2 shell integration isn't working
Had the same problem. Running this command fixed the problem to me:

curl -L https://iterm2.com/misc/install_shell_integration.sh | bash


It will re-install shell integration. You can found more details on the following link.