-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
wait isn't interruptable #858
Comments
I guess this is about when the main loop runs signal handlers. Unrelated: doc edits.
Thanks for the report! I reproduced this bug. I think the bug is that signal handlers run in the main interpreter loop, and Originally I thought this would be better fixed in the C++ translation, because signals are a bit different there, but it's possible it is an algorithmic problem. I'll look into it, thanks! |
Addresses issue #858. Also improve test case. Found the same bug in dash! bash/mksh/zsh have special cases that allow you to interrupt the 'wait' builtin. Also make note of bug with Ctrl-C / SIGINT, due to KeyboardInterrupt.
I just fixed this -- thanks for this great bug report! It looks like bash/zsh/mksh all have a special flag to make the The fix will be out with the next release. Sort of related: I'm looking for feedback on Oil's enhanced shell tracing: http://www.oilshell.org/preview/doc/xtrace.html https://old.reddit.com/r/oilshell/comments/l0sshn/tracing_execution_in_oil_set_x_xtrace/ |
Also, 2 out of 3 cases work for 'interruptible wait'. Still need to fix the broken -1 invariant.o Related to issue #858.
Oh wow, |
I've noticed that wait isn't interruptable like it is in bash, which cased some issues with scripts relying on background sleep and trap behavior.
This is a trivial reproduction case trimmed from a project with lots of similar scripts.
When running in bash, sending USR1 to the process will immediately run the trap handler.
Running the same script in osh requires us to wait for the full 10 second sleep before the handler is executed.
The text was updated successfully, but these errors were encountered: