Skip to content

Conversation

@alganet
Copy link

@alganet alganet commented Nov 3, 2025

  • no pipefail yet
  • no special interactive handling (but it seems to work fine)
  • added a simple fix for set -o <flagname> in order to test it
  • recursion tests were failing, added a fix
  • added tests for a bunch of use cases

- Add `OPT_e` (errexit) to global options.
- Add `ERREXIT_OK` flag to `struct sh_pipeline` to track execution context at parse time.
- Update `set_main` to handle `set -e`, `set +e`, `set -o errexit`, `set +o errexit`.
- Fix `set -o` logic where options were incorrectly disabled.
- Update `parse_line` and `add_pl` to identify contexts where errexit should be ignored (`if`, `while`, `&&`, `||`, `!`).
- Update `run_lines` to perform the exit check after command execution.
- Update `run_subshell` to disable errexit for command substitution `$()`.
@alganet
Copy link
Author

alganet commented Nov 27, 2025

I updated the initial idea to be more in line with the existing code, moved errexit checks to parse time, and removed the attempt at fixing the recursion stuff (realized those are probably unfinished ideas I have no business messing with).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant