From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29716 invoked from network); 8 Sep 2003 20:19:21 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Sep 2003 20:19:21 -0000 Received: (qmail 6339 invoked by alias); 8 Sep 2003 20:19:04 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6540 Received: (qmail 6329 invoked from network); 8 Sep 2003 20:19:04 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 8 Sep 2003 20:19:04 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.238.4.143] by sunsite.dk (MessageWall 1.0.8) with SMTP; 8 Sep 2003 20:19:3 -0000 Received: from elanus (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id A985E4BD5 for ; Mon, 8 Sep 2003 22:19:03 +0200 (DFT) Received: from elanus.its.uu.se(127.0.0.1) by elanus.its.uu.se via virus-scan id s30735; Mon, 8 Sep 03 22:18:40 +0200 Received: from localhost (NL04-165-13.STUDENT.UU.SE [10.11.165.13]) by elanus.its.uu.se (Postfix) with ESMTP id 9D7A24A93 for ; Mon, 8 Sep 2003 22:18:40 +0200 (DFT) Received: from jesper by localhost with local (Exim 4.20) id 19wSSh-0001va-Gg for zsh-users@sunsite.dk; Mon, 08 Sep 2003 22:18:11 +0200 Date: Mon, 8 Sep 2003 22:18:11 +0200 From: Jesper Holmberg To: Zsh-users List Subject: precmd not being updated when I want Message-ID: <20030908201811.GU6280@strindberg.student.uu.se> Mail-Followup-To: Zsh-users List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i I have this: precmd() { psvar[1]=$#jobtexts; [[ $#jobtexts -eq 0 ]] && psvar[1]=0; } PS1="%(1v.%v .)$cpath${end}%# " which gives me the number of jobs first in my prompt. It works very well. However, if a job finishes, the number of jobs in the prompt does not update until I type a new command and hit . Thus: 0 jesper@strindberg:~% sleep 1 & [1] 7392 1 jesper@strindberg:~% [1] + done sleep 1 1 jesper@strindberg:~% 0 jesper@strindberg:~% Notice how sleep reports it is finished, but the prompt still shows "1". Only when I hit on the second to last line, the "1" is turned into a "0". Is there a way to fix this? TIA, Jesper