Skip to content

Instantly share code, notes, and snippets.

@jandahl
Created May 8, 2013 12:38
Show Gist options
  • Save jandahl/5540164 to your computer and use it in GitHub Desktop.
Save jandahl/5540164 to your computer and use it in GitHub Desktop.
Update screen/byobu window title based on hostname you want to ssh to
#!/usr/bin/env bash
# Remember to check your $TERM and fix the conditional below
if [ $TERM == "screen-bce" ] ; then
trap 'echo -n -e "\033k${HOSTNAME}\033\\"' 0 1 2 15
echo -n -e "\033k$1\033\\"
fi
/usr/bin/ssh $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment