参照:https://groups.google.com/forum/#!msg/iterm2-discuss/GbXOOaJDhvk/-mmgUwarAAAJ
Look in your ~/.profile, ~/.bash_profile, ~/.login, ~/.zshrc, or ~/.config/fish/config.fish (which file it's in depends on what shell you use) for a line like this:
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
And remove it.