Skip to content

Discard remaining commands on shell errors if interactive#151

Merged
magicant merged 6 commits into
trunkfrom
shell-error
Apr 3, 2025
Merged

Discard remaining commands on shell errors if interactive#151
magicant merged 6 commits into
trunkfrom
shell-error

Conversation

@magicant

@magicant magicant commented Apr 3, 2025

Copy link
Copy Markdown
Owner

POSIX says:

In all of the cases shown in the table where an interactive shell is required not to exit and a non-interactive shell is required to exit, an interactive shell shall not perform any further processing of the command in which the error occurred.

Existing shells seem to abort the current command execution and prompt for a next command when they encounter such an error. This pull request makes yash follow this convention.

magicant added 6 commits April 3, 2025 00:47
This commit renames the E_SUSPEND exception to E_CANCEL. The E_CANCEL
exception will be raised not only when a foreground job is suspended but
also when a shell error occurs that would terminate the shell if it were
not interactive. This change is made to make the exception name match
its purpose.
@magicant magicant added this to the 2.59 milestone Apr 3, 2025
@magicant magicant self-assigned this Apr 3, 2025
@magicant magicant mentioned this pull request Apr 3, 2025
56 tasks
@magicant
magicant merged commit 731d071 into trunk Apr 3, 2025
@magicant
magicant deleted the shell-error branch April 3, 2025 13:21
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