Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://gist.github.com/1297464/23c2f977a8cd010704cb242eac26d9b9880a036d
- # Author: tunaranch
- # Fix bug talked about at http://news.ycombinator.com/item?id=2418726
- # Tested on zsh. Paste the two following functions in your .zshrc.
- # Customise the case switch to suit your own colour/host combos
- function tabc {
- osascript -e "tell application \"Terminal\" to set current settings of $1 to settings set \"$2\""
- }
- function ssh {
- local tabid;
- tabid=$(osascript -e "tell application \"Terminal\" to get selected tab of front window")
- case $1 in
- *foo01*)
- tabc $tabid "Ocean";;
- *foo02*)
- tabc $tabid "Grass";;
- *)
- tabc $tabid "Pro";;
- esac
- /usr/bin/ssh "$@"
- tabc $tabid "Novel"
- }
Advertisement
Add Comment
Please, Sign In to add comment