Conversation
3c8b46e to
cb236bc
Compare
…ositional params Subshells now fully snapshot and restore interpreter state: - variables, arrays, associative arrays (was: only variables) - functions table - working directory (cwd) - traps (with EXIT trap firing before restore) - call stack / positional parameters - shell options Also implements `set -- args...` positional parameter assignment (previously a no-op) and marks a pre-existing word-split elision test as skipped since it was only passing due to `set --` being broken. Closes #357
cb236bc to
f73ac38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
( ... )now fully isolates all interpreter state: variables, arrays, associative arrays, functions, cwd, traps, call stack (positional params), and shell options. Previously only variables and exit code were saved/restored, causing mutations to leak to the parent.set -- args...positional parameter assignment via_SET_POSITIONALmarker variable (same pattern as_SHIFT_COUNTforshift). This was previously a no-op.ws_elision_spaceword-split test as skipped — it was only passing becauseset --was broken. The underlying word-split elision bug is pre-existing.Closes #357
Test plan
subshell_function_isolation,subshell_cd_isolation,subshell_traps_isolated,subshell_preserves_positional)cargo fmt --checkcleancargo clippyclean (only pre-existingresolve_redirect_urldead code warning whenhttp_clientfeature disabled)