Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#444583: zsh: precmd not executed before a new prompt is displayed when a job exists



On Sat, 29 Sep 2007 11:28:45 -0400
Clint Adams <schizo@xxxxxxxxxx> wrote:
> On Sat, Sep 29, 2007 at 05:10:35PM +0200, Bas Zoetekouw wrote:
> > Zsh's man page says: "precmd   Executed before each prompt."
> > However, it doesn't seem to be executed in the following situation:
> > 
> > - start xeyes in the background (xeyes &)
> > - kill the xeyes window
> > - the zsh then displays something like "[1]  + done  xeyes" and a new
> >   prompt.  Before this prompt, the precmd command doesn't seem to be
> >   executed.
> > 
> > This situation is a bit annoying for be, because I use precmd to put
> > the number of background jobs in the xterm title.  However, when I
> > kill one of these backgorund applications, the xterm title isn't
> > updated currently.
> 
> Could someone clarify the documentation here?

How about this?

Index: Doc/Zsh/func.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/func.yo,v
retrieving revision 1.15
diff -u -r1.15 func.yo
--- Doc/Zsh/func.yo	10 Nov 2006 09:59:27 -0000	1.15
+++ Doc/Zsh/func.yo	1 Oct 2007 09:40:01 -0000
@@ -188,7 +188,9 @@
 findex(precmd)
 vindex(precmd_functions)
 item(tt(precmd))(
-Executed before each prompt.
+Executed before each prompt.  Note that precommand functions are not
+reexecuted simply because the command line is redrawn, as happens, for
+example, when a notification about an exiting job is displayed.
 )
 findex(preexec)
 vindex(preexec_functions)



-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author