Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_PCNT
	autolearn=no autolearn_force=no version=3.4.0
Date: Fri, 22 Jan 2016 02:32:50 +0100
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: zle-line-finish behavior and documentation
Message-ID: <20160122013250.GA26912@zira.vinc17.org>
Mail-Followup-To: zsh-workers@zsh.org
References: <20160114145631.GB12351@cventin.lip.ens-lyon.fr>
 <160114182256.ZM18156@torch.brasslantern.com>
 <20160121124620.GB21104@cventin.lip.ens-lyon.fr>
 <160121110449.ZM25615@torch.brasslantern.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <160121110449.ZM25615@torch.brasslantern.com>
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/1.5.24-6551-vl-r83103 (2016-01-05)
X-Seq: zsh-workers 37727

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 <vincent@vinc17.net> - 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)

