Commit 57f0d76
Fix flush() to handle VirtualPipe on stdio fds
In nested subshells, fd 1 (stdout) may be replaced with a VirtualPipe
from an outer subshell's dup2 operation. When fd_renumber tries to flush
fd 1 before replacing it, stdout_mut() returns FsError::NotAFile because
VirtualPipe is not Kind::File.
This fix makes flush() handle the NotAFile case gracefully for stdio fds,
since pipes don't require explicit flushing. This fixes nested backticks
in bash command substitution:
echo `echo \`echo hi\`` # Previously failed with "Invalid argument"
The $() command substitution still fails because bash requires /dev/fd
which is not yet implemented in WASIX.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent ebf9a02 commit 57f0d76
1 file changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1565 | 1565 | | |
1566 | 1566 | | |
1567 | 1567 | | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1571 | 1579 | | |
1572 | 1580 | | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
1576 | 1591 | | |
1577 | 1592 | | |
1578 | 1593 | | |
| |||
0 commit comments