|
Sujet : [Zsh] Resolu : Pb d'affectation de variable avec precmd() |
| serialcleaner |
Résolu.
Un petit tour sur http://www.zsh.org/mla/users/2004/msg00531.html et la solution est apparue.
precmd () {
if [ "$(_print-first-todo)" != "" ]
then
#print TODO \: $(_print-first-todo)
todo=">> $(_print-first-todo)"
else
todo=""
fi
# print $(_print-first-todo)
# todo=$(_print-first-todo)
if [[ $TERM == "xterm" ]]; then
PS1="$host $cpath $todo
[%j] $end"
# export RPS1=$' %{\e[48;5;233m%} %{\e[48;5;234m%} %{\e[48;5;235m%} %{\e[48;5;236m%} %{\e[48;5;237m%} %{\e[48;5;238m%} %{\e[48;5;239m%} %{\e[48;5;240m%} %{\e[48;5;241m%} %{\e[48;5;242m%} %{\e[48;5;243m%} %{\e[48;5;244m%} %{\e[48;5;245m%} %{\e[48;5;246m%} %{\e[48;5;247m%} %{\e[48;5;248m%} %{\e[48;5;249m%} %{\e[48;5;250m%} %{\e[48;5;251m%} %{\e[48;5;252m%} %{\e[38;5;232m%}%D{%H:%M} %{\e[0m%}'
export RPS1=$'%D{%H:%M}'
else
PS1="$date $host $cpath
$end"
fi
}
|
Il fallait redéfinir le prompt dans la precmd ;) |