Skip to content

Instantly share code, notes, and snippets.

@sheldonh
Created August 10, 2010 09:52
Show Gist options
  • Select an option

  • Save sheldonh/517007 to your computer and use it in GitHub Desktop.

Select an option

Save sheldonh/517007 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
if [ x"$OVERRIDE_WINDOW_TITLE" != x"" ]; then
title=$OVERRIDE_WINDOW_TITLE
else
title=${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}
fi
case $TERM in
xterm*|rxvt|Eterm|eterm)
echo -ne "\033]0;$title\007"
;;
screen)
echo -ne "\033_$title\033\\"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment