From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5219 invoked from network); 1 Oct 2001 17:45:07 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Oct 2001 17:45:07 -0000 Received: (qmail 27468 invoked by alias); 1 Oct 2001 17:44:42 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4307 Received: (qmail 27453 invoked from network); 1 Oct 2001 17:44:42 -0000 X-Authentication-Warning: greux.loria.fr: lefevre set sender to vincent@vinc17.org using -f Date: Mon, 1 Oct 2001 19:44:06 +0200 From: Vincent Lefevre To: zsh-users@sunsite.dk Subject: Re: get the number of active jobs to show in the prompt? Message-ID: <20011001194406.A25184@greux.loria.fr> Mail-Followup-To: zsh-users@sunsite.dk References: <200110010600.f9160iq10821@bang.houseoflove> <200110010828.SAA20292@bruce.csse.monash.edu.au> <20011001110454.A7643@globnix.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20011001110454.A7643@globnix.org> User-Agent: Mutt/1.3.22.1i X-Mailer-Info: http://www.vinc17.org/mutt_eng.html On Mon, Oct 01, 2001 at 11:04:54 +0200, Phil Pennock wrote: > zmodload zsh/parameter > function precmd { [... all the other bits ...] > psvar[2]=$#jobstates; [[ $psvar[2] -eq 0 ]] && psvar[2]=() > } > and then in PS1: %(2v:<+%2v>:-) There is a small problem, though: When a job terminates and the prompt is reprinted, precmd isn't called and the prompt isn't rebuilt, so that I still get the old prompt. I'd prefer to get a new prompt (a bit like when I type [Return]). Is there an option to have this behaviour? -- Vincent Lefèvre - Web: - 100% validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des Jeux Mathématiques et Logiques, TETRHEX, etc. Work: CR INRIA - computer arithmetic / SPACES project at LORIA