# change tab color for ssh
tab-color(){echo-ne"\033]6;1;bg;red;brightness;$1\a"echo-ne"\033]6;1;bg;green;brightness;$2\a"echo-ne"\033]6;1;bg;blue;brightness;$3\a"}
tab-reset(){echo-ne"\033]6;1;bg;*;default\a"}# Change the color of the tab when using SSH# reset the color after the connection closes
s(){if[[-n"$ITERM_SESSION_ID"]];then
trap"tab-reset" INT EXIT
if[["$*"=~ "production|ec2-.*compute-1"]];then
tab-color 255 0 0
else
tab-color 0 255 0
fi
fi
ssh $*}
compdef _ssh s=ssh