Skip to content

Instantly share code, notes, and snippets.

@ezza
Last active January 18, 2016 03:44
Show Gist options
  • Save ezza/61966bdc2d46183e937d to your computer and use it in GitHub Desktop.
Save ezza/61966bdc2d46183e937d to your computer and use it in GitHub Desktop.
Colourify SSH terminal sessions
# Add this to ~/.profile
function tabc() {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change
# "Default" to the name of your default theme
echo -e "\033]50;SetProfile=$NAME\a"
}
function colorssh() {
tabc SSH
ssh $*
tabc
}
function colorvagrantssh() {
tabc Vagrant
vagrant ssh $*
tabc
}
alias vssh="colorvagrantssh"
alias ssh="colorssh"
# Then configure iterm2 as shown in the screenshots
@ezza
Copy link
Author

ezza commented Jan 18, 2016

Configure iTerm2 with three profiles named like this:

screen shot 2016-01-18 at 2 37 42 pm

Configure the Background Color option to something meaningful (I use dull red for SSH and dull green for Vagrant). In the works is blue for beta servers.

screen shot 2016-01-18 at 2 41 13 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment