1 2 3 4 5 6 7 8 9 10 11 12 13
# vim: ft=sh function settitle { if command -v whoami >/dev/null && command -v hostname >/dev/null && command -v pwd >/dev/null; then echo -ne "\033]0;$(whoami)@$(hostname):$(pwd)\007" fi } case "$TERM" in xterm*|*rxvt*|*st*) trap 'settitle' DEBUG ;; esac