Subject: TRAPCHLD (was Re: segfault in completion for configure)
From: Bart Schaefer <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Sun, 13 Mar 2016 08:20:52 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

> > } On 2016-03-11 15:00:56 -0800, Bart Schaefer wrote:
> > } > [...] if you have a TRAPCHLD function it's
> > } > possible that it's corrupting something.

TRAPCHLD is a rather blunt instrument for what Vincent wants to do
here (update the window title with job status).  There's no reason to
update the title bar in the middle of a completion upon the exit from
a command substitution, but there's no way to tell why the CHLD signal
was delivered or what the surrounding shell state may be.

Any thoughts on ways to refine this?  Perhaps a job status change hook
instead of relying on a signal trap?

Semi-related, I've noticed that the CHLD trap is not executed when a
foreground job exits.  Presumably that's because wait() is reaping the
process before the signal is generated.