Skip to content

fix(interpreter): apply redirects left-to-right for correct fd duplication#860

Closed
chaliy wants to merge 1 commit intomainfrom
fix/issue-853-redirect-ordering
Closed

fix(interpreter): apply redirects left-to-right for correct fd duplication#860
chaliy wants to merge 1 commit intomainfrom
fix/issue-853-redirect-ordering

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 27, 2026

Summary

  • Redirects are now applied left-to-right so 2>&1 >file correctly captures stderr in $() while writing stdout to file
  • Previously both stdout and stderr went to the file; now fd duplication respects the state at the time each redirect is processed

Test plan

  • New redirect ordering spec tests
  • Full spec test suite green

Closes #853

@chaliy chaliy force-pushed the fix/issue-853-redirect-ordering branch from b0e807b to 763a829 Compare March 27, 2026 00:39
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.

bug: result=$(cmd 2>&1 >file) redirect ordering incorrect

1 participant