81d340e7e285

Fix the prompt quoting and expansion once and for all.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 21 Aug 2009 17:22:52 -0400
parents 4e6f4c9d1215
children 8d48478fb2bc
branches/tags (none)
files .bashrc

Changes

--- a/.bashrc	Fri Aug 21 17:16:46 2009 -0400
+++ b/.bashrc	Fri Aug 21 17:22:52 2009 -0400
@@ -48,14 +48,17 @@
 
 # Prompt stuff ---------------------------------------------------------------
 
-D=$'\e[37;40m'
-PINK=$'\e[35;40m'
-GREEN=$'\e[32;40m'
-ORANGE=$'\e[33;40m'
+D=$'\[\e[37;40m\]'
+PINK=$'\[\e[35;40m\]'
+GREEN=$'\[\e[32;40m\]'
+ORANGE=$'\[\e[33;40m\]'
 
 hg_ps1() {
     hg prompt "{${D} on ${PINK}{branch}}{${D} at ${ORANGE}{bookmark}}{${GREEN}{status}}{${GREEN}{update}}" 2> /dev/null
 }
 
-export PS1='\n${PINK}\u ${D}at ${ORANGE}\h ${D}in ${GREEN}\w$(hg_ps1)\
-${D}\n$ '
+render_ps1() {
+    echo "\n${PINK}\u ${D}at ${ORANGE}\h ${D}in ${GREEN}\w$(hg_ps1)${D}\n$ "
+}
+
+PROMPT_COMMAND='PS1="`render_ps1`"'"; $PROMPT_COMMAND"
\ No newline at end of file