mirror of
https://github.com/nushell/nushell.git
synced 2024-11-08 01:24:38 +01:00
make print flush (#5566)
This commit is contained in:
parent
498672f5e5
commit
f26d3bf8d7
@ -37,7 +37,6 @@ impl Command for Print {
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
let args: Vec<Value> = call.rest(engine_state, stack, 0)?;
|
||||
let no_newline = call.has_flag("no_newline");
|
||||
|
||||
let head = call.head;
|
||||
|
||||
for arg in args {
|
||||
|
@ -437,6 +437,7 @@ impl PipelineData {
|
||||
if let Some(stream) = stream {
|
||||
for s in stream {
|
||||
let _ = stdout.lock().write_all(s?.as_binary()?);
|
||||
let _ = stdout.lock().flush()?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -475,7 +476,9 @@ impl PipelineData {
|
||||
}
|
||||
|
||||
match stdout.lock().write_all(out.as_bytes()) {
|
||||
Ok(_) => (),
|
||||
Ok(_) => {
|
||||
let _ = stdout.lock().flush()?;
|
||||
}
|
||||
Err(err) => eprintln!("{}", err),
|
||||
};
|
||||
}
|
||||
@ -498,7 +501,9 @@ impl PipelineData {
|
||||
}
|
||||
|
||||
match stdout.lock().write_all(out.as_bytes()) {
|
||||
Ok(_) => (),
|
||||
Ok(_) => {
|
||||
let _ = stdout.lock().flush()?;
|
||||
}
|
||||
Err(err) => eprintln!("{}", err),
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user