Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
Created November 11, 2012 01:15
Show Gist options
  • Save NapoleonWils0n/4053262 to your computer and use it in GitHub Desktop.
Save NapoleonWils0n/4053262 to your computer and use it in GitHub Desktop.
macosx: change colour on ssh connections
#!/bin/sh
# this code goes in your .bash_profile
# change colour on ssh connections and then back to the default theme
function tabc {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi
osascript -e "tell application \"Terminal\"
set myWindow to front window
set myTab to selected tab of myWindow
try
set current settings of myTab to settings set \"$NAME\"
end try
end tell"
}
function ssh {
tabc "Homebrew ssh"
/usr/bin/ssh "$@"
tabc "Homebrew"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment