Subject: Re: zle-line-finish behavior and documentation
From: Vincent Lefevre <[email-masked]>
To: [email-masked]
Date: Fri, 22 Jan 2016 02:32:50 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On 2016-01-21 11:04:49 -0800, Bart Schaefer wrote:
> The PS1 prompt does get updated on reset-prompt, it works with:
> 
>   PS1="%1v$PS1"
>   zle-line-init () {
>     (( $+ZLE_LINE_ABORTED )) && psvar[1]='ABORT ' || psvar[1]=''
>     unset ZLE_LINE_ABORTED
>     zle reset-prompt
>   }

Thanks. It works also together with my previous code related to the
exit status. My code now has:

precmd()
{
  psvar[1]=$?
  if [[ $psvar[1] -gt 128 ]] then
    local sig=$signals[$(($psvar[1]-127))]
    [[ -n $sig ]] && psvar[1]=$sig
  fi
  [...]
}

zle-line-init()
{
  [...]
  (( $+ZLE_LINE_ABORTED )) && psvar[1]+=!
  unset ZLE_LINE_ABORTED
  zle reset-prompt
}

zle-line-finish()
{
  zle reset-prompt
}

-- 
Vincent Lefèvre <[email-masked]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)