Repository navigation
fix(parser): redirect and heredoc combos; function redirects stop streaming - #2589
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 72b78b4 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 07:45 PM |
…eaming - redirected function calls no longer stream their output to the caller - `&>> file` parses as `>> file 2>&1` - several heredocs per line, `N<<EOF`, words/redirects after a heredoc - `paste - -` shares stdin between `-` operands Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
The coverage build overflowed TM-DOS-044 depth-50 nested $( ). Move the new arms into out-of-line helpers, share one heredoc parser between simple and compound commands, and heap-allocate the nested $( ) parser. Debug stack need for the test: 2.05 MB -> 2.01 MB (main 2.02 MB). Claude-Session: https://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
chaliy
force-pushed
the
claude/redirect-fixes
branch
from
October 7, 2026 19:45
6a1fe8b to
72b78b4
Compare
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
f > outwrote tooutand also printed to the caller (the CLI andexec_streaming).&>> fileis lexed and parsed as>> file 2>&1. It was a parse error.cat <<A <<B, the last is stdin), and so do words after one (cat <<A file).done <<A 3<<B >out).N<<EOFtargets fd N (newToken::HereDocFd) and does not feed stdin. It was a3word plus a stdin heredoc.paste - -hands stdin lines to its-operands in turn, like GNU. With-s, the first one takes everything.Why
These are roadmap step 1 fidelity gaps from the Debian-oracle shell cases
redirect-stdout-stderr-combosandheredoc-multiple-same-line. Both cases now match bash. The function leak was the worst: any agent runninglog() {...}; log > filethrough the CLI or a streaming host saw the output twice.Before / After
f() { echo out; }; f > o.txt(CLI)outecho a &>> x.txtcat <<A <<B…ABpaste - - <<A 3<<B…3: command not founda1 a2printf '1\n2\n3\n' | paste - -1 1/2 2/3 31 2/3Proof: new spec
redirect-heredoc-combos.test.sh(7 cases, bash-verified), new integration testredirected_function_output_is_not_streamed, andbash_comparisonpasses.Risk
Low-medium. This is a parser change: the lexer now always re-injects the line break after a heredoc delimiter, and the simple-command loop keeps parsing after a heredoc instead of stopping. Full lib, integration and comparison suites pass.
Checklist
cargo test -p bashkit --lib/--test integration/bash_comparison-D warnings, fmt,check-okfhttps://claude.ai/code/session_019aFikmptPc91Fj4N2iDXQA
Generated by Claude Code