Skip to content
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

Implement the rest of the trap builtin -- ERR hook, SIGINT, etc. #60

Open
andychu opened this issue Jan 3, 2018 · 1 comment
Open
Labels

Comments

@andychu
Copy link
Contributor

andychu commented Jan 3, 2018

Mentioned here and in issue #59

https://www.reddit.com/r/oilshell/comments/7lqbzc/osh_03_optimization_benchmarks_and_bug_fixes/

There are multiple parts to trap, so it may take multiple steps.

andychu pushed a commit that referenced this issue Jan 21, 2018
Also added demo/trap.sh, and moved some other scripts in gold/ to demo/.
(These tests are difficult to automate.)

- Print signal names with -l
- Parse arguments and handle errors

Still need to hook up the code to signals and hooks.

Addresses issue #60.
andychu pushed a commit that referenced this issue Jan 21, 2018
- Fix removal of hooks/signal handlers.
- Warn if the ERR, DEBUG, or RETURN hook is used.

Addresses issue #60.
andychu pushed a commit that referenced this issue Jan 24, 2018
Instead of running the handler directly, the Python signal handler
queues a node in ex.nodes_to_run.  Then the main loop checks this on
every invocation of _Execute().

demo/trap.sh: expose EINTR / Ctrl-C problems with OSH.  OSH traps only
work for basic use cases right now, since we're building on top of
Python's signal module for now.

Addresses issue #60.
@andychu
Copy link
Contributor Author

andychu commented Jan 25, 2018

Released with 0.4.alpha1: http://www.oilshell.org/releases.html

The functionality is pretty basic -- EXIT and some signals -- but that case is very common.

Leaving this open since it's incomplete.

@andychu andychu changed the title Implement the trap builtin Implement the rest of the trap builtin -- ERR hook, SIGINT, etc. Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant