Select your shell to see the appropriate instructions: This is also what you must do if you use a shell that isn't your login shell. When you select the iTerm2>Install Shell Integration menu item, it types this for you: curl -L | bashĭon't care for piping curl to bash? Do it by hand. Contributions for other shells are most welcome. The following shells are supported: tcsh, zsh, bash, and fish 2.3 or later.
You should do this on every host you ssh to as well as your local machine. It will download and run a shell script as described below.
The easiest way to install shell integration is to select the iTerm2>Install Shell Integration menu item. ITerm2 may be integrated with the unix shell so that it can keep track of your command history, current working directory, host name, and more-even over ssh.