When executing a Rust program using the bacon run command for the first time, the standard output is flushed on every newline. However, on subsequent runs, flushing appears to occur only upon program termination rather than as expected — every time the program itself issues a flush.
Expected Behavior
The expectation is for bacon run to flush the output consistently, in alignment with the behavior of my Rust program, which flushes after each output operation.
Current Behavior
Initial bacon run execution: Output is flushed on every newline.
Subsequent bacon run executions: Output is flushed only upon program termination.
Steps to Reproduce
Use the following Rust code snippet:
use std::{
io::{stdout, Write},
thread::sleep,
time::Duration,
};
fn main() {
for i in 0..10 {
print!("\n{i}: ");
for j in 0..10 {
print!("{j} ");
stdout().flush().unwrap();
sleep(Duration::from_millis(100));
}
}
}
Run the program using cargo run to observe the expected behavior where every number is printed sequentially.
Execute the program using bacon run to note the difference: only every line is printed during execution.
On automatic execution upon save, observe that the output is displayed wholly at the end.
When executing a Rust program using the
bacon run
command for the first time, the standard output is flushed on every newline. However, on subsequent runs, flushing appears to occur only upon program termination rather than as expected — every time the program itself issues a flush.Expected Behavior
The expectation is for
bacon run
to flush the output consistently, in alignment with the behavior of my Rust program, which flushes after each output operation.Current Behavior
bacon run
execution: Output is flushed on every newline.bacon run
executions: Output is flushed only upon program termination.Steps to Reproduce
Use the following Rust code snippet:
Run the program using
cargo run
to observe the expected behavior where every number is printed sequentially.Execute the program using
bacon run
to note the difference: only every line is printed during execution.On automatic execution upon save, observe that the output is displayed wholly at the end.
Environment