summaryrefslogtreecommitdiff
path: root/11_Prompts.zsh
diff options
context:
space:
mode:
authorhugues <hugues@a0e5b806-a6f9-0310-978d-cbce73f8a913>2007-07-19 15:40:10 +0000
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:13 +0100
commit469ee055dbbfd706ecc10c8356844846e6d6a0ea (patch)
tree8bdf60810c851090dee63e931c8aac5dd247fe3e /11_Prompts.zsh
parent890d94bdad7dea66c22d0e0cf470ce6c0b148966 (diff)
Idem
git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@482 a0e5b806-a6f9-0310-978d-cbce73f8a913
Diffstat (limited to '11_Prompts.zsh')
-rw-r--r--11_Prompts.zsh9
1 files changed, 5 insertions, 4 deletions
diff --git a/11_Prompts.zsh b/11_Prompts.zsh
index 9b30552..fedda83 100644
--- a/11_Prompts.zsh
+++ b/11_Prompts.zsh
@@ -100,8 +100,9 @@ precmd ()
term_title
DATE=$(date "+%H:%M:%S-%d/%m/%Y")
- ERROR='%?'
- HBAR=
+ ERROR=%(? "---" "%3<<"$C_$COLOR_BAR$_C"---"$C_$COLOR_ERRR$_C"%?%<<")
+ CURDIR=$C_$COLOR_PATH$_C"%(!.%d.%(5~:.../:)%4~)"$C_$VOID$_C${$(git branch 2>&-):+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_BRANCH$_C$(git branch | grep '^\*' | cut -c3-)}
+ unset HBAR
for i in {1..$(($COLUMNS - ${#DATE} - 3 - 2))}
do
HBAR=$HBAR-
@@ -111,8 +112,8 @@ precmd ()
# Affiche l'user, l'host, le tty et le pwd. Rien que ça...
# Note que pour le pwd, on n'affiche que les 4 derniers dossiers pour éviter
# de pourrir le fenêtre de terminal avec un prompt à rallonge.
- PS1=$C_$COLOR_BAR$_C"-"%(? "---" $C_$COLOR_ERRR$_C"%4>>%?"$C_$COLOR_BAR$_C"--->")$C_$COLOR_BAR$_C$HBAR$C_$COLOR_DATE$_C$DATE$C_$COLOR_BAR$_C"-
-"$C_$COLOR_USER$_C"%n"$C_$COLOR_AROB$_C"@"$C_$COLOR_HOST$_C"%m "$C_$COLOR_PAREN$_C"("$C_$COLOR_TERM$_C"%y"$C_$COLOR_PAREN$_C") "$C_$COLOR_BRACES$_C"["$C_$COLOR_PATH$_C"%(!.%d.%(5~:.../:)%4~)"$C_$VOID$_C${$(git branch 2>&-):+$C_$COLOR_DOUBLEDOT$_C:$C_$COLOR_BRANCH$_C$(git branch | cut -c3-)}$C_$COLOR_BRACES$_C"]"$C_$VOID$_C${LD_PRELOAD:t:s/lib//:r}" "$C_$COLOR_HIST$_C"%h"$C_$COLOR_DIES$_C"%#"$C_$VOID$_C" "
+ PS1=$C_$COLOR_BAR$_C"-"$ERROR$C_$COLOR_BAR$_C$HBAR$C_$COLOR_DATE$_C$DATE$C_$COLOR_BAR$_C"-
+"$C_$COLOR_USER$_C"%n"$C_$COLOR_AROB$_C"@"$C_$COLOR_HOST$_C"%m "$C_$COLOR_PAREN$_C"("$C_$COLOR_TERM$_C"%y"$C_$COLOR_PAREN$_C") "$C_$COLOR_BRACES$_C"["$CURDIR$C_$COLOR_BRACES$_C"]"$C_$VOID$_C${LD_PRELOAD:t:s/lib//:r}" "$C_$COLOR_HIST$_C"%h"$C_$COLOR_DIES$_C"%#"$C_$VOID$_C" "
}
chpwd()