Skip to content

feat: support redirects in pipe sequence commands#177

Open
bartlomieju wants to merge 1 commit into
mainfrom
feat/redirects-in-pipe-sequence
Open

feat: support redirects in pipe sequence commands#177
bartlomieju wants to merge 1 commit into
mainfrom
feat/redirects-in-pipe-sequence

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

The parser previously rejected redirects on any command in a pipe
sequence (e.g. cmd 2>&1 | tee log), even though the AST's Command
node already carries a per-command redirect and the executor's
execute_command applies it before dispatching to execute_simple_command
/ execute_subshell. Drop the parser bailout in parse_pipeline_inner
so common bash idioms like cmd 2>&1 | reader and cmd > file | reader
parse and execute.

The existing negative parser test that asserted the error message is
replaced with two positive parser tests covering echo 1 1> stdout.txt | cat and cmd 2>&1 | tee log. Two integration tests exercise the
runtime behavior end-to-end: that the left side's stdout redirect makes
the right side receive an empty pipe, and that 2>&1 | correctly
funnels both stdout and stderr into the pipe.

Fixes denoland/deno#28808.

The parser previously rejected redirects on any command in a pipe
sequence (e.g. `cmd 2>&1 | tee log`), even though the AST already
carries a per-command `redirect` and the executor's `execute_command`
applies it before dispatching to `execute_simple_command` /
`execute_subshell`. Drop the parser bailout so common bash idioms like
`cmd 2>&1 | reader` and `cmd > file | reader` parse and execute.

Fixes denoland/deno#28808.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 29, 2026

CLA assistant check
All committers have signed the CLA.

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.

Support redirects in pipe sequences in deno.json tasks

2 participants