From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 521 invoked from network); 3 Oct 2001 00:06:56 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Oct 2001 00:06:56 -0000 Received: (qmail 13548 invoked by alias); 3 Oct 2001 00:06:45 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4312 Received: (qmail 13537 invoked from network); 3 Oct 2001 00:06:45 -0000 MIME-Version: 1.0 From: Vincent Lefevre To: zsh-users@sunsite.dk Date: Wed, 03 Oct 2001 02:06:37 +0200 Subject: Re: get the number of active jobs to show in the prompt? Message-ID: <4ac3633923vincent@vinc17.org> In-Reply-To: <200110022325.JAA07306@bruce.csse.monash.edu.au> References: <20011002181324.A29201@greux.loria.fr> <200110022325.JAA07306@bruce.csse.monash.edu.au> User-Agent: Pluto/2.03e (RISC-OS/4.02) POPstar/2.03 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In article <200110022325.JAA07306@bruce.csse.monash.edu.au>, Deborah Ariel Pickett wrote: > What you seem to want is for zsh to instantly be interrupted and have it > re-process the prompt. > How? The current command should be saved in a safe place. Then, the necessary functions (e.g., precmd()) should be called. Finally, the current command should be restored and displayed with the new prompt(s). > Should it run precmd() again to do so? What if there's stuff in > precmd() that isn't to do with generating the prompt, but is instead > involved in dealing with command history? This is not a problem. When the user is typing a command (even if multiline), the command isn't in the history yet. > You wouldn't want that to run again, because you haven't finished typing > your command. Why not? Or perhaps there should be two different functions: precmd(), which should behave like now, and preprompt(), which should be run just before the prompt is (re)displayed. Then, the code that modifies the prompt should be in preprompt(). -- 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