config-bash/rc.d/termtitle

12 lines
281 B
Plaintext
Raw Normal View History

#!/bin/bash
# Change the window title of X terminals
case $TERM in
xterm*|rxvt*|urxvt*|Eterm)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
;;
screen*)
PROMPT_COMMAND='echo -ne "\033k${USER}@${HOSTNAME%%.*}\033\\"'
;;
esac