Last Updated: February 25, 2016
·
1.241K
· haihappen

Change your Terminal.app theme when sshing

With this little snippet inside your .zshrc your Terminal will switch to another Theme when sshing (and it will switch back automagically after exiting).

# Change theme of Terminal.app
tabc() {
  NAME="${1:-Default}"
  osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\""
}

# Change to Danger theme when executing ssh
ssh() {
  tabc Danger
  /usr/bin/ssh "$*"
  tabc
}

Change your Terminal.app theme when sshing