Skip to content

Commit

Permalink
Truncate long messages in the progress bar (#214)
Browse files Browse the repository at this point in the history
* Truncate long messages in the progress bar
  • Loading branch information
sigmaSd committed Dec 14, 2021
1 parent add6a59 commit a3d3e5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ impl Progress {
thread::spawn(move || {
let template = {
let mut t = String::new();
t += "{prefix} [{elapsed_precise}] ";
t += "{wide_msg} [{elapsed_precise}] ";
if precise && current_position_fn.is_some() {
t += "[{wide_bar:.cyan/blue}] ";
t += "[{bar:.cyan/blue}] ";
} else {
t += "{spinner:.green} ";
}
Expand All @@ -88,7 +88,7 @@ impl Progress {
pb.tick();
}
if let Ok(msg) = msg_rx.try_recv() {
pb.set_prefix(msg);
pb.set_message(msg);
}
thread::sleep(Duration::from_millis(100));
}
Expand Down

0 comments on commit a3d3e5d

Please sign in to comment.