Skip to content

Instantly share code, notes, and snippets.

@dctucker
Forked from wadey/iterm2.zsh
Last active May 31, 2017 17:17
Show Gist options
  • Save dctucker/94e466b0cc99fc0e202f4c1d56f5631a to your computer and use it in GitHub Desktop.
Save dctucker/94e466b0cc99fc0e202f4c1d56f5631a to your computer and use it in GitHub Desktop.
Change iTerm2 tab color when using SSH
# Usage:
# source tabcolor.sh 96 96 192
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
rgb() {
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"
}
reset() {
echo -ne "\033]6;1;bg;*;default\a"
}
if [ '$1' == 'reset' ]; then
reset
else
rgb $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment