diff options
Diffstat (limited to 'zsh')
| -rw-r--r-- | zsh/oh-my-zsh/iTerm2-ssh.zsh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/zsh/oh-my-zsh/iTerm2-ssh.zsh b/zsh/oh-my-zsh/iTerm2-ssh.zsh new file mode 100644 index 0000000..6f19818 --- /dev/null +++ b/zsh/oh-my-zsh/iTerm2-ssh.zsh @@ -0,0 +1,28 @@ +function tabc() { + NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi + 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 + if [[ "$*" =~ "ceres" ]]; then + tabc "SSH - Ceres" + elif [[ "$*" =~ "ug04" || "$*" =~ "tw" ]]; then + tabc "SSH - SoCS" + else + tabc "SSH - Unknown" + fi +# tabc SSH + fi + ssh $* +} +compdef _ssh tabc=ssh + +alias ssh="colorssh" + |
