Skip to content

trap: Implement POSIX.1-2024 requirements#115

Merged
magicant merged 1 commit into
trunkfrom
trap-p
Feb 11, 2025
Merged

trap: Implement POSIX.1-2024 requirements#115
magicant merged 1 commit into
trunkfrom
trap-p

Conversation

@magicant

Copy link
Copy Markdown
Owner

This commit implements the requirements of POSIX.1-2024 for the trap built-in. The trap built-in now supports the -p option in the POSIXly-correct mode. When the -p option is used, the built-in prints all traps without filtering out traps that are not set. The built-in also reports signals that are ignored because the program that invoked the shell has set the signal to be ignored.

Closes #113

This commit implements the requirements of POSIX.1-2024 for the `trap`
built-in. The `trap` built-in now supports the `-p` option in the
POSIXly-correct mode. When the `-p` option is used, the built-in prints
all traps without filtering out traps that are not set. The built-in
also reports signals that are ignored because the program that invoked
the shell has set the signal to be ignored.

The test case file is synced with:
https://github.com/magicant/yash-rs/blob/c348c1f0fed18be5b760bd1ed5ec73f224e53731/yash-cli/tests/scripted_test/trap-p.sh
@magicant magicant added the enhancement New feature or request label Feb 11, 2025
@magicant magicant added this to the 2.59 milestone Feb 11, 2025
@magicant magicant self-assigned this Feb 11, 2025
@magicant
magicant merged commit 245d7fd into trunk Feb 11, 2025
@magicant
magicant deleted the trap-p branch February 11, 2025 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update trap built-in to support POSIX.1-2024

1 participant