Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thejbsmith/8800ece338e71d19484e to your computer and use it in GitHub Desktop.
Save thejbsmith/8800ece338e71d19484e to your computer and use it in GitHub Desktop.
Switch iTerm2 Profile during SSH Sessions
# Add the following to your .bash_profile or .bashrc file in order to switch to a different iTerm profile during an ssh session.
# This same code could be re-purposed for any command, not just ssh
# Set iTerm2 Profile
set_iterm_profile() {
echo -e "\033]50;SetProfile=$1\a"
}
# Switch iTerm2 Profile during SSH Sessions
ssh() {
set_iterm_profile <profile_name>
command ssh $@
set_iterm_profile <profile_name>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment