Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: and lists and suspended processes
- X-seq: zsh-workers 20644
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Clint Adams <schizo@xxxxxxxxxx>
- Subject: Re: and lists and suspended processes
- Date: Mon, 3 Jan 2005 10:19:34 -0800 (PST)
- Cc: zsh-workers@xxxxxxxxxx, 288323-forwarded@xxxxxxxxxxxxxxx, 288323-submitter@xxxxxxxxxxxxxxx
- In-reply-to: <20050103041512.GA22489@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20050103041512.GA22489@xxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
On Sun, 2 Jan 2005, Clint Adams wrote:
> Should zsh wait for a suspended process to exit before continuing along
> the sublist?
I believe I was involved in a related discussion not that long ago.
Trouble is, I can't recall if it was on zsh-workers or austin-group or
somewhere else, and searching the zsh archives isn't helping me.
The short answer is, no, zsh can't wait for the suspended process to exit.
Given "one && two && three", if "two" stops, the shell has three choices:
(1) pretend the command was "{ one && two && three }" and suspend the
entire sublist; or
(2) pretend that "two" has returned a status and continue the junction; or
(3) stop the entire shell until "two" is resumed.
Choice (1) is undesirable because it subverts the user's intent (if he
meant there to be braces, he should have typed them) and it puts "three"
into a separate process when it might better have been run in the current
shell. Choice (3) is impossible in an interactive shell. That leaves
(2), which is what zsh does, using the signal number as the status.
If there's a bug, it's that zsh returns $? == 20 rather than $? == 148.
I forget why that's done -- maybe it's a compromise because $? > 127 would
indicate the signal caused the child to exit, which is not the case here.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author