mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 17:35:16 +01:00
squash! Add buffering to stdout when it's not a terminal
Co-authored-by: sourlemon207 <jw1756@protonmail.com>
This commit is contained in:
parent
7b7876e701
commit
e990a13405
2 changed files with 4 additions and 1 deletions
|
@ -93,7 +93,8 @@ fn print_entry_colorized<W: Write>(
|
|||
}
|
||||
|
||||
if wants_to_quit.load(Ordering::Relaxed) {
|
||||
stdout.flush()?;
|
||||
// Ignore any errors on flush, because we're about to exit anyway
|
||||
let _ = stdout.flush();
|
||||
ExitCode::KilledBySigint.exit();
|
||||
}
|
||||
|
||||
|
|
|
@ -280,6 +280,7 @@ fn spawn_receiver(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
num_results += 1;
|
||||
if let Some(max_results) = config.max_results {
|
||||
if num_results >= max_results {
|
||||
|
@ -294,6 +295,7 @@ fn spawn_receiver(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we have finished fast enough (faster than max_buffer_time), we haven't streamed
|
||||
// anything to the console, yet. In this case, sort the results and print them:
|
||||
buffer.sort();
|
||||
|
|
Loading…
Reference in a new issue