Skip to content

stdout and stderr are sometimes interleaved #363

Open
@narpfel

Description

@narpfel

When a command produces output on both stdout and stderr, sometimes both are interleaved.

Small reproducer (with cargo new t && cd t):
src/main.rs:

fn main() {
    for i in 0..10 {
        println!("stdout: {i}");
    }
    for i in 0..10 {
        eprintln!("stderr: {i}");
    }
}

bacon run:

     Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
      Running `target/debug/t`
 stdout: 0
 stderr: 0
 stdout: 1
 stdout: 2
 stdout: 3
 stdout: 4
 stdout: 5
 stdout: 6
 stdout: 7
 stdout: 8
 stdout: 9
 stderr: 1
 stderr: 2
 stderr: 3
 stderr: 4
 stderr: 5
 stderr: 6
 stderr: 7
 stderr: 8
 stderr: 9

(This sometimes needs a few tries.)

This is especially noticeable when the program normally produces output on stdout and then dbg!() is used to produce additional debug output.


$ bacon --version
bacon 3.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions