+ PROMPT_COMMAND=prompt-command
+
+ settitle () {
+ if [[ $TERM == screen* ]]; then
+ local title_escape="\033]..2;"
+ else
+ local title_escape="\033]0;"
+ fi
+ if [[ $* != prompt-command ]]; then
+ echo -ne "$title_escape$USER@$HOSTNAME ${PWD/#$HOME/~} $*\007"
+ fi
+ }
+
+ # for titlebar
+ # condition from the screen man page i think
+ if [[ $TERM == *(screen*|xterm*|rxvt*) ]]; then
+ trap 'settitle "$BASH_COMMAND"' DEBUG
+ else
+ trap DEBUG
+ fi
+