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: Thu, 14 Jan 2016 18:16:31 +0100
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: prompt update and TRAPCHLD
Message-ID: <20160114171631.GC12351@cventin.lip.ens-lyon.fr>
Mail-Followup-To: zsh-workers@zsh.org
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/1.5.24-6551-vl-r83103 (2016-01-05)
X-Seq: zsh-workers 37626

There seems to be a bug in the prompt update. The change of psvar[1]
in TRAPCHLD is not taken into account for the next prompt display,
but for the following one.

cventin% PS1="%*-%1v%% "
18:15:11-% TRAPCHLD() { psvar[1]=$RANDOM }
18:15:17-% sleep 3 & sleep 5 & sleep 7 &
[1] 29121
[2] 29122
[3] 29123
18:15:25-% 
[1]    done       sleep 3
18:15:28-% 
[2]  - done       sleep 5
18:15:30-32134% 
[3]  + done       sleep 7
18:15:32-30185% 
18:15:35-25600% 
18:15:36-25600% 
18:15:37-25600% 
18:15:39-25600% 

-- 
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)

