This is fairly obscure. If the "wait" command is used
inside a loop construct ("for", "while", etc.), and a
background job is stopped by a signal while the "wait"
is waiting, zsh believes that the loop received the
signal and suspends the entire loop.
The "jobs" command then incorrectly shows that the job
for which zsh was waiting was piped to the standard
input of the "for" loop.
This patch fixes both problems. Originallyposted by
Sven in zsh-workers/14327.