Repository navigation
fix(redirect): route /dev/stdout, /dev/stderr, /dev/fd/N to descriptors - #2512
Merged
Merged
Conversation
echo err > /dev/stderr wrote a regular VFS file named /dev/stderr and printed nothing. Resolve /dev/stdin, /dev/stdout, /dev/stderr and /dev/fd/N at the interpreter level like /dev/null, as dups of the descriptor's current target, across the fast, fd-table and exec paths. Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | ec71cd6 | Commit Preview URL Branch Preview URL |
Oct 06 2026, 07:14 PM |
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.
Requested by Михайло · project thread
What changed
Redirections to
/dev/stdin,/dev/stdout,/dev/stderrand/dev/fd/Nnow behave like on Linux: they alias the descriptor's current target (> /dev/stderris>&2,> /dev/fd/3is>&3,< /dev/stdinkeeps stdin,exec 3>/dev/stderrdups fd 2). They are resolved at the interpreter level like/dev/nulland never reach the VFS. Covers the fast redirect path, the fd-table path (mixed2>&1+ file),&>,>>, variable targets and..spellings.First PR of the "closer to real bash" roadmap (Step 1, fidelity bugs).
Why
echo err > /dev/stderrsilently wrote a 3-byte regular file/dev/stderrin the VFS and printed nothing. Agents use this pattern constantly for error messages, so errors vanished.Before / After
Real bash 5.2 cross-checked for the tricky shapes:
2>&1 >/dev/stderrsends both streams to stdout;exec 3>/dev/stderr; echo x >&3goes to stderr.Risk
/dev/std{in,out,err}or/dev/fd/<digits>change behaviour. Process-substitution paths (/dev/fd/proc_sub_*) are untouched. Builtin file operands (tee /dev/stderr,cat /dev/stdin) are a follow-up, noted inknowledge/foundations/vfs.md.Checklist
https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code