Skip to content

fix(interpreter): route exec fd redirects through VFS targets#1034

Merged
chaliy merged 1 commit intomainfrom
fix/issue-938-exec-fd-devnull
Apr 3, 2026
Merged

fix(interpreter): route exec fd redirects through VFS targets#1034
chaliy merged 1 commit intomainfrom
fix/issue-938-exec-fd-devnull

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 3, 2026

Summary

  • Add persistent exec_fd_table to track fd output targets set by exec N>/path
  • exec N>/dev/null now properly discards writes to fd N
  • exec N>/file routes writes to the VFS file
  • exec N>&M duplicates fd targets; exec N>&- closes them
  • Both apply_redirections and apply_redirections_fd_table check exec_fd_table

Test plan

  • Unit tests: test_exec_fd_to_dev_null, test_exec_fd_to_file
  • Spec tests: exec-fd-redirect.test.sh (4 cases: dev/null, file, dup, close)
  • Full test suite passes (2222 tests)

Closes #938

@chaliy chaliy merged commit 8c03e30 into main Apr 3, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-938-exec-fd-devnull branch April 3, 2026 10:33
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.

exec N>/dev/null does not suppress output written to fd N

1 participant