You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(interpreter): prefix env assignments visible to commands (#200)
## Summary
- **Fix**: `VAR=value command` now temporarily injects VAR into the
command's environment, matching bash behavior. Previously prefix
assignments were stored in shell variables only, invisible to builtins
like `printenv`.
- **Fix**: Prefix assignments no longer persist in shell variables after
the command completes (they are command-scoped, as in bash).
- Extracted `execute_dispatched_command` method for clean save/restore
around command execution.
## Test plan
- [x] 8 unit tests in `lib.rs` (positive: visible in env, multiple vars,
empty value; negative: not persistent, not found without prefix)
- [x] 6 spec tests in `variables.test.sh` covering positive, negative,
and edge cases
- [x] 6 differential edge cases comparing against real bash in
`proptest_differential.rs`
- [x] New proptest strategy + property test for prefix assignments (50
random cases)
- [x] `cargo fmt --check` clean
- [x] `cargo clippy --all-targets --all-features -- -D warnings` clean
- [x] `cargo test --all-features` all pass (934+ unit, 573 spec, 53
proptest)
- [x] Updated specs (005-builtins, 009-implementation-status) and docs
(compatibility.md)
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments