case "$TERM" in
*rxvt*|screen*|*term*|vt100)
if [ -z "$1" ]; then
- TITLE="${USER}@${HOSTNAME}:$(echo ${PWD} | sed -e "s|^${HOME}|~|")"
+ TITLE="${USER}@`hostname`:$(echo ${PWD} | sed -e "s|^${HOME}|~|")"
else
TITLE="$@"
fi
- echo -n "\033]0;${TITLE}\007" # Set xterm title
+ XTITLE="\033]0;${TITLE}\007" # Set xterm title/icon
case "$TERM" in
screen*)
- echo -n "\033k${TITLE}\033\\" # Set screen/tmux caption
+ XTITLE="\033P${XTITLE}\033\\\\" # Set xterm title/icon under screen/tmux
+ XTITLE="${XTITLE}\033k${TITLE}\033\\\\" # Set screen/tmux caption
;;
esac
+ echo -n "$XTITLE"
;;
esac