f78372a5d4ce

Actually update this time.  Stupid symlinks...
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 19 Jun 2009 21:08:48 -0400
parents cc98f087d46b
children f0242d032ba3 2e174ecf0ce1
branches/tags (none)
files .bashrc

Changes

--- a/.bashrc	Fri Jun 19 20:51:07 2009 -0400
+++ b/.bashrc	Fri Jun 19 21:08:48 2009 -0400
@@ -16,31 +16,14 @@
 
 # Prompt stuff ---------------------------------------------------------------
 
-DEFAULT="[37;40m"
-PINK="[35;40m"
-GREEN="[32;40m"
-ORANGE="[33;40m"
+D=$'\e[37;40m'
+PINK=$'\e[35;40m'
+GREEN=$'\e[32;40m'
+ORANGE=$'\e[33;40m'
 
-hg_dirty() {
-    hg status --no-color 2> /dev/null \
-    | awk '$1 == "?" { unknown = 1 } 
-           $1 != "?" { changed = 1 }
-           END {
-             if (changed) printf "!"
-             else if (unknown) printf "?" 
-           }'
+hg_ps1() {
+    hg prompt "{${D} on ${PINK}{branch}}{${D} at ${ORANGE}{bookmark}}{${GREEN}{status}}" 2> /dev/null
 }
 
-hg_branch() {
-    hg branch 2> /dev/null | \
-        awk '{ printf "\033[37;0m on \033[35;40m" $1 }'
-    hg bookmarks 2> /dev/null | \
-        awk '/\*/ { printf "\033[37;0m at \033[33;40m" $2 }'
-}
-
-export PS1='\n\e${PINK}\u \
-\e${DEFAULT}at \e${ORANGE}\h \
-\e${DEFAULT}in \e${GREEN}\w\
-$(hg_branch)\e${GREEN}$(hg_dirty)\
-\e${DEFAULT}\n$ '
-
+export PS1='\n${PINK}\u ${D}at ${ORANGE}\h ${D}in ${GREEN}\w$(hg_ps1)\
+${D}\n$ '
\ No newline at end of file