Put following line into your .zshrc
set_iterm_profile() { echo -e "\033]50;SetProfile=$1\a" }
Put colorssh.zsh
file into ~/.oh-my-zsh/custom/
folder.
# Create a file inside ~/.oh-my-zsh/custom/ | |
function tabc() { | |
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi | |
# if you have trouble with this, change | |
# "Default" to the name of your default theme | |
echo -e "\033]50;SetProfile=$NAME\a" | |
} | |
function tab-reset() { | |
NAME="Default" | |
echo -e "\033]50;SetProfile=$NAME\a" | |
} | |
function colorssh() { | |
if [[ -n "$ITERM_SESSION_ID" ]]; then | |
trap "tab-reset" INT EXIT | |
tabc SSH | |
fi | |
ssh $* | |
} | |
compdef _ssh colorssh=ssh | |
alias ssh="colorssh" |