I have recently switched over to iTerm2 and love it. I am wondering though if there is a way to use profiles to correspond to what environment/specific machine you are on.
for zsh users
lets say you have 2 profiles, one named mac (for your primary machine) and one for linux (your remote machine)
when entering the session, we need to tell zsh to load our profile
~/.zshrc
add echo -e "\033]50;SetProfile=linux\a"
source ~/.zshrc
when exiting the session, we need to tell zsh to switch back to our original profile
~/.zlogout
add the followingif [ "$SHLVL" = 1 ]; then
echo -e "\033]50;SetProfile=mac\a"
clear
fi
now you can swap profiles with ease <3.
if you are using bash, i believe the steps are similar but you would instead modify ~/.bashrc
and ~/.bash_logout
demo