diff rc/bash @ 254:dde04581a2bf

Combined PS1 and PROMPT_COMMAND conditional.
author Edho Arief <edho@myconan.net>
date Mon, 14 Nov 2011 11:08:45 +0300
parents e6de49d70fe7
children 4a0f963a3ff1
line wrap: on
line diff
--- a/rc/bash	Mon Nov 14 11:06:47 2011 +0300
+++ b/rc/bash	Mon Nov 14 11:08:45 2011 +0300
@@ -21,15 +21,6 @@
   [ -d "${i}" ] && PATH="${i}:${PATH}"
 done
 
-case "${TERM}" in
-  xterm*|dtterm*|screen*)
-    PS1='[\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\] \[\e[1;34m\]\W\[\e[0m\]]\$ '
-  ;;
-  *)
-    PS1='[\u@\h \W]\$ '
-  ;;
-esac
-
 shopt -s histappend
 PROMPT_COMMAND='history -a'
 export HISTFILESIZE=10000
@@ -114,8 +105,12 @@
 
 
 case "${TERM}" in
-  xterm*|screen*|dtterm)
+  xterm*|screen*|dtterm*)
     PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007";'"${PROMPT_COMMAND}"
+    PS1='[\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\] \[\e[1;34m\]\W\[\e[0m\]]\$ '
+  ;;
+  *)
+    PS1='[\u@\h \W]\$ '
   ;;
 esac