Fix try printing when it is not the last pipeline element (#13992)

# Description

Fixes #13991. This was done by more clearly separating the case when a
pipeline is drained vs when it is being written (to a file).

I also added an `OutDest::Print` case which might not be strictly
necessary, but is a helpful addition.

# User-Facing Changes

Bug fix.

# Tests + Formatting

Added a test.

# After Submitting

There are still a few redirection bugs that I found, but they require
larger code changes, so I'll leave them until after the release.
This commit is contained in:
Ian Manske
2024-10-11 23:37:10 -07:00
committed by GitHub
parent 0e3a8c552c
commit de08b68ba8
14 changed files with 127 additions and 194 deletions

View File

@@ -62,8 +62,8 @@ pub(crate) struct StackOutDest {
impl StackOutDest {
pub(crate) fn new() -> Self {
Self {
pipe_stdout: None,
pipe_stderr: None,
pipe_stdout: Some(OutDest::Print),
pipe_stderr: Some(OutDest::Print),
stdout: OutDest::Inherit,
stderr: OutDest::Inherit,
parent_stdout: None,