blob: 6f19818e47aae2483f6324a32b8f711611e03867 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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"
|