fix(interpreter): pipelines no longer drain the shared stdin to EOF (#328)
`executePipeline` cleared `state.groupStdin` before every stage after the
first so a stage fed empty pipe output could not fall back to the shell's
stdin — but it never put it back. Running any pipeline therefore left the
enclosing shell at EOF, whether or not a stage read anything, so
`{ read a; true | true; read b; }` lost the second line and
`while read …; do … | …; done < file` ran exactly once.
Carry the shell's stdin across the stages instead: the first stage keeps
it (bash hands fd 0 to the head of a pipeline), later stages still see it
hidden, and each stage hands back whatever the first stage left. A `read`
in the first stage advances the shared position; `true | true` reads
nothing and leaves it alone. The hand-back runs in a `finally`, so a stage
that throws does not strand the shell at EOF either.
Closes #323.
Claude-Session: https://claude.ai/code/session_019DayCPuYZEmv4VszJXTHT3
Signed-off-by: Lars Trieloff <lars@trieloff.net>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> L
Lars Trieloff committed
65dafd55afbfa7e62642ce485787f7d65fad4961
Parent: edc7f2f
Committed by GitHub <noreply@github.com>
on 8/6/2026, 2:03:44 AM