-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a few things to make $&wait
ing more flexible.
#149
base: master
Are you sure you want to change the base?
Conversation
Also add $&sigmessage primitive.
Some caveats/potential alternatives:
A number of the questions I have are in the general category of when we would want to have
|
Here's something potentially interesting that It's only a sketch (note the awkward use of A more process-group-aware es could also account for stopped children in some intelligent way in |
This PR adds a few things:
First, an
-n
flag forwait
, which corresponds withwaitpid(WNOHANG)
. This can be used to implement acheck-wait
function during%prompt
, something some shells do automatically.To support that use case, there is a new hook function
%echo-status
, which is called when any process isewait()
ed for, and performs the work of printing the "interesting" signal terminations. A default implementation is provided which should be the same as the current behavior. A quick-and-dirty way to hack on this function is to simply setfn-%echo-status = echo
to see how every process exits:To make a backwards-compatible
%echo-status
possible, this PR also adds a new$&sigmessage
primitive which externalizes thesigmessage()
function. This seems generally useful for signal exception handlers as well; the%interactive-loop
function has been modified to use this primitive.Putting these all together, the following enables the "check-wait" behavior on prompt like in other, job controlling shells: