Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups
On Mar 24, 5:34pm, Stephane Chazelas wrote:
} Subject: Re: "echo | ps -j $(:) | cat | cat | cat" runs components in diff
}
} Bart explained that it was because zsh uses the first spawned
} process (here to run a builtin) for the process group, makes
} other processes, that first process has already returned and has
} been waited for so zsh can't make the other processes join the
} foreground process group.
}
} I think here, zsh should not wait for that process until all the
} processes in the jobs have been started and joined the process
} group if that's what from a now-zombie process.
That's going to require a lot of mucking about, because currently
all process reaping is done in signal handlers. The shell only
explicitly waits for the rightmost process in a pipeline. The
SIGCHLD can't be blocked because then the exit of $(cat) in the
second pipe step could not be captured, so the handler *will* be
called when "echo" exits.
Also once that process has exited, setpgrp() won't make it a group
leader any longer. Zsh would have to block "echo" from *starting*
until the rest of the pipeline was built.
This is all because most shells fork both sides of a pipeline,
whereas zsh attempts to only fork the left side so that a builtin
loop on the right can capture the output into the current shell.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author