Created
April 16, 2015 13:42
-
-
Save thejbsmith/8800ece338e71d19484e to your computer and use it in GitHub Desktop.
Switch iTerm2 Profile during SSH Sessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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