implemented err pipes

This commit is contained in:
2026-03-05 10:51:24 -05:00
parent e07a853074
commit b46877edde
2 changed files with 13 additions and 8 deletions

View File

@@ -702,7 +702,7 @@ impl Dispatcher {
}
}
fn exec_pipeline(&mut self, pipeline: Node) -> ShResult<()> {
let NdRule::Pipeline { cmds, pipe_err: _ } = pipeline.class else {
let NdRule::Pipeline { cmds } = pipeline.class else {
unreachable!()
};
self.job_stack.new_job();
@@ -726,6 +726,10 @@ impl Dispatcher {
}
if let Some(pipe) = wpipe {
self.io_stack.push_to_frame(pipe);
if cmd.flags.contains(NdFlags::PIPE_ERR) {
let err_redir = Redir::new(IoMode::Fd { tgt_fd: STDERR_FILENO, src_fd: STDOUT_FILENO }, RedirType::Output);
self.io_stack.push_to_frame(err_redir);
}
} else {
for redir in std::mem::take(&mut out_redirs) {
self.io_stack.push_to_frame(redir);