From: Frank Terbeck Date: Thu, 11 Sep 2008 10:06:05 +0000 (+0200) Subject: zshrc: Fixing $PS2 X-Git-Tag: 0.3.57~1 X-Git-Url: https://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=2766d2da77c8ea7f4b06a6ed1d9fe3f791d90374 zshrc: Fixing $PS2 We use prompt_subst for vcs_info() to work. PS2 contained a backtick, which starts off command substitution. There was no closing backtick (because the backtick is meant to be there for cosmetic reasons only), so that threw a parsing error now. Thanks to Matthias Merk noticing. This also removes some dead comments. --- diff --git a/debian/changelog b/debian/changelog index 2de0297..6873818 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.3.57) unstable; urgency=low + + * zshrc: Fixed $PS2, which included a backtick, which is special when + setopt prompt_subst is set. Thanks to Matthias Merk for reporting. + + -- Frank Terbeck Thu, 11 Sep 2008 12:00:14 +0200 + grml-etc-core (0.3.56) unstable; urgency=low [ Frank Terbeck ] diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index b368970..6141171 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1627,11 +1627,6 @@ fi setopt prompt_subst -# precmd() => a function which is executed just before each prompt -# use 'NOPRECMD=1' to disable the precmd + preexec commands - -# precmd () { setopt promptsubst; [[ -o interactive ]] && jobs -l; - # make sure to use right prompt only when not running a command is41 && setopt transient_rprompt @@ -1642,7 +1637,7 @@ is4 && [[ -z $NOPRECMD ]] && precmd () { # allow manual overwriting of RPROMPT if [[ -n $RPROMPT ]] ; then - [[ $TERM == screen* ]] && echo -n $'\ekzsh\e\\' + [[ $TERM == screen* ]] && print -nP "\ekzsh\e\\" # return 0 fi # just use DONTSETRPROMPT=1 to be able to overwrite RPROMPT @@ -1664,8 +1659,6 @@ is4 && [[ -z $NOPRECMD ]] && precmd () { esac } -# chpwd () => a function which is executed whenever the directory is changed - # preexec() => a function running before every command is4 && [[ -z $NOPRECMD ]] && \ preexec () { @@ -1696,7 +1689,7 @@ preexec () { } EXITCODE="%(?..%?%1v )" -PS2='`%_> ' # secondary prompt, printed when the shell needs more information to complete a command. +PS2='\`%_> ' # secondary prompt, printed when the shell needs more information to complete a command. PS3='?# ' # selection prompt used within a select loop. PS4='+%N:%i:%_> ' # the execution trace prompt (setopt xtrace). default: '+%N:%i>'