summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--11_Prompts.zsh18
1 files changed, 14 insertions, 4 deletions
diff --git a/11_Prompts.zsh b/11_Prompts.zsh
index e1b759b..53952a4 100644
--- a/11_Prompts.zsh
+++ b/11_Prompts.zsh
@@ -44,7 +44,7 @@ COLOR_BAR="0;$GENERIC;$BOLD"
COLOR_BRACES=$COLOR_BAR
COLOR_BRANCH_OR_REV="0;$GENERIC"
-COLOR_NOT_UP_TODATE="0;$YELLOW"
+COLOR_NOT_UP_TODATE="0;$GREEN;$BOLD"
COLOR_TOBE_COMMITED="0;$YELLOW;$BOLD"
COLOR_CMD="$VOID"
@@ -86,7 +86,7 @@ term_title()
preexec ()
{
- term_title " ··· $(echo $1 | tr '\n' ';' | sed 's/%/%%/g')"
+ term_title " ··· $(echo $1 | tr '\n' ';' | sed 's/%/%%/g;s/\\/\\\\/g')"
print -Pn "$C_$COLOR_EXEC$_C"
}
@@ -94,6 +94,16 @@ GITCHECK=${GITCHECK:-yeah}
#SVNCHECK=${SVNCHECK:-yeah}
#unset GITCHECK SVNCHECK
+preprint()
+{
+ hbar=
+ for i in {1..$(($COLUMNS - ${#1} - 5))}
+ do
+ hbar=$hbar-
+ done
+ print -Pn "${C_}0;30;1${_C}${hbar}[ $1 ]-\r"
+}
+
precmd ()
{
term_title
@@ -110,7 +120,7 @@ precmd ()
then
if [ "$GITCHECK" != "" ]
then
- print -n "Checking git status...\r"
+ preprint "Checking git status..."
_git_status=$(git-runstatus 2>&- | grep -E '^# ([[:alpha:]]+ )+(but not|to be)( [[:alpha:]]+)+:$')
if [ "$(grep "but not" <<< $_git_status)" != "" ] ; then
COLOR_GIT=$COLOR_NOT_UP_TODATE
@@ -129,7 +139,7 @@ precmd ()
SVNREV=$(svn info 2>&- | grep '^Révision : ' | sed 's/^.* : /r/')
if [ "$SVNREV" != "" ]
then
- if [ "$SVNCHECK" != "" ] && ( print -n "Checking svn status...\r" ; [ $(svn status 2>&- | grep -v '^?' | wc -l) -gt 0 ] )
+ if [ "$SVNCHECK" != "" ] && ( preprint "Checking svn status..." ; [ $(svn status 2>&- | grep -v '^?' | wc -l) -gt 0 ] )
then
COLOR_SVN=$COLOR_NOT_UP_TODATE
else