-
Notifications
You must be signed in to change notification settings - Fork 4
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
New trap built-in semantics #450
base: master
Are you sure you want to change the base?
Conversation
This commit makes `TrapState::origin` optional. If the value is `None`, it means the action was inherited from the previous process that `exec`ed the shell. This change is preparation for removing the `Setting` enum.
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This commit changes the `GrandState` struct to retain the `TrapState` struct instead of the `Setting` enum as the current and parent trap state. The current definition of `Setting` does not use `Action::Default` or `Action::Ignore` variants for the initial disposition, which complicates the computation of the current signal disposition. This commit changes the `GrandState` struct to use the `TrapState` struct directly, so that the current signal disposition can always be computed from the `action` field of the `TrapState` struct. The `Setting` enum will be removed in the next commit.
This commit changes the origin of the current trap state to Subshell when entering a subshell. Previously, the origin was set to Inherited for backward compatibility but was incorrect. This commit also updates the tests to reflect the new behavior. Especially, TrapSet::get_state now returns a reference to the current state instead of None after entering a subshell.
Previously, the current state's action was set to Action::Default when EnterSubshellOption::Ignore was passed to GrandState::enter_subshell. This commit changes it to Action::Ignore, so that the action indicates the actual configuration of the trap. This change is necessary for the trap built-in to print all traps correctly, including ones that are not configured by the user.
No description provided.