X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fprompt.bashrc;h=8114b292a9918e9a828bc1bce791894719a0ff27;hb=refs%2Fheads%2Fmaster;hp=58c2222421123284dc0fccd9857b04b84fcf2445;hpb=6d1a3c415482b587dbadc1323ff37c1319ecfd2e;p=profile.git diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc index 58c2222..8114b29 100644 --- a/.profile.d/prompt.bashrc +++ b/.profile.d/prompt.bashrc @@ -1,17 +1,13 @@ -# $Id$ -# -# Set the title of an xterm to the hostname. -# +_prompt_command_escape=1 -SSH_FORWARDED=$(get_remote_ip -n) -if [ ! -z "$SSH_FORWARDED" ]; then - if [ ! "$SSH_FORWARDED" = "10.99.10.121" -a ! "$SSH_FORWARDED" = "ip01pc" ]; then - SSH_FORWARDED=" (from $SSH_FORWARDED)" - else - SSH_FORWARDED= - fi +# Actual dtterm barfs on escape sequences. +if [ "$TERMINAL_EMULATOR" = "dtterm" ]; then + unset _prompt_command_escape fi -info="$HOSTNAME$SSH_FORWARDED" -blank=$(echo $info | sed 's/./ /g') -export PROMPT_COMMAND="echo -ne '\033]0;$info\007\r$blank\r'" -unset info blank SSH_FORWARDED + +# As does screen on an ancient Solaris host. +if [ -n "$OLDSOLARIS" -a ! "${TERM##screen}" = "$TERM" ]; then + unset _prompt_command_escape +fi + +PROMPT_COMMAND='shopt -q nullglob; ng=$?; shopt -s nullglob; for snippet in ${PROFILE_HOME:-~}/.prompt.d/*.prompt; do . $snippet; done; unset snippet; [ $ng = 0 ] || shopt -u nullglob; unset ng'