changeset 250:4a8d81743728

Automated bash color prompt.
author Edho Arief <edho@myconan.net>
date Tue, 08 Nov 2011 22:31:10 +0700
parents 68b765e9cf76
children d7e5a2e70cf3 4fe8668e3ef0
files rc/bash
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rc/bash	Wed Nov 09 10:36:15 2011 +0000
+++ b/rc/bash	Tue Nov 08 22:31:10 2011 +0700
@@ -16,8 +16,14 @@
 _org_path="${PATH}"
 export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
 
-PS1='[\u@\h \W]\$ '
-#PS1='[\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\] \[\e[1;34m\]\W\[\e[0m\]]\$ '
+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'