summaryrefslogtreecommitdiff
path: root/11_Prompts.zsh
diff options
context:
space:
mode:
authorhugues <hugues@a0e5b806-a6f9-0310-978d-cbce73f8a913>2007-08-09 14:21:49 +0000
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:17 +0100
commit8189834afd33d92b003e4b3ede0f8737ed80e1c1 (patch)
tree6f73e48492005572755c1cf8b965edebcc39c290 /11_Prompts.zsh
parentc8b28b026b8bac4e3a87031145e63c3d3ee36ff8 (diff)
oulah.git-svn
git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@536 a0e5b806-a6f9-0310-978d-cbce73f8a913
Diffstat (limited to '11_Prompts.zsh')
-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