X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2Fprompt.bashrc;h=a80c6152cf61c3a8d6cb101db5c09fadcf04c0d6;hp=6ee910ecf20283ef475ff4a5ed823840580eb346;hb=ef195791b38325931b2d3007b9c409389aa43797;hpb=d5880063af930084c3ac1cc8f756a9db0e2cbb71 diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc index 6ee910e..a80c615 100644 --- a/.profile.d/prompt.bashrc +++ b/.profile.d/prompt.bashrc @@ -1,5 +1,3 @@ -# $Id$ -# # Set the title of an xterm to the hostname. # @@ -24,12 +22,22 @@ info="$HOSTNAME$SSH_FORWARDED" vimchild=" [vim]" if ps -o comm= -p $PPID 2>/dev/null | grep '^vim*$' &>/dev/null; then # Clear [vim] when exiting. - trap "echo -ne '\\033]0;$info\\007'" exit + trap "echo -ne '\\033]0;$info\\033\\0134'" exit info="$info$vimchild" fi if [ "${TERM##screen}" = "$TERM" ]; then - export PROMPT_COMMAND="echo -ne '\033]0;$info\007\r\033[K'" + export PROMPT_COMMAND="echo -ne '\033]0;$info\033\0134\r\033[K'" else - export PROMPT_COMMAND='echo -ne "\033k\033\\"' + export PROMPT_COMMAND='echo -ne "\033k\033\0134"' fi unset blank info vimchild SSH_FORWARDED + +# Actual dtterm barfs on escape sequences. +if [ "$TERMINAL_EMULATOR" = "dtterm" ]; then + unset PROMPT_COMMAND +fi + +# As does screen on an ancient Solaris host. +if [ -n "$OLDSOLARIS" -a ! "${TERM##screen}" = "$TERM" ]; then + unset PROMPT_COMMAND +fi