-
Notifications
You must be signed in to change notification settings - Fork 940
Switch to indicatif for the progress bar #2828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1,11 +1,13 @@ | |||
use std::fmt::{self, Display}; | |||
|
|||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't sure what to do here since I didn't know if it would be useful in the future, so I decided to ignore the warning. Thoughts?
Edit: I've figured out a way around it. |
I was confused as to why this problem was happening in the first place, since the logic seems sound at first glance. I semi-replicated it with this minimal example: use std::{io::Write, time::Duration};
fn main() {
let mut n = 0;
for i in 0..=1000 {
let string = format!("Progress: {}", i);
print!("\r{}", " ".repeat(n));
print!("\r");
print!("{}", string);
std::io::stdout().flush().unwrap();
n = string.chars().count();
std::thread::sleep(Duration::from_millis(50));
}
} And it worked correctly. I'll look into it more, hopefully there's a simpler solution than this PR. |
Indeed, the problem lies with |
Actually, I'll reopen this to see which direction you guys want. I could go ahead and adapt the current progress bar to use |
Hi Kirawi -- thank you for putting the effort into this PR, and I'm really sorry that it has taken me so long to get to it. I have reasons, but they make poor excuses. If you are still interested in working on improving our UX then I'd love to discuss with you the merits of what you came up with here vs. what you think crossterm might offer. |
Haha no worries, I myself have gotten a bit busy. I'm interested on continuing working on this, but it may have to wait another month or so for me to squeeze in the time to do it. However, I won't be offended if someone else decides to pick it up. |
Closing due to staleness. I may come back to it some other day if it isn't tackled by someone else. |
@kirawi Thanks! Just to clarify, this is still on our roadmap, it's just that I've adjusted the roadmap to include the issue if possible, rather than directly pointing to the PR. |
Resolves #1826 #1835
Output on Alacritty:
Alternatively, I can also look into integrating
crossterm
instead.26/8/2021: I'll get back to this when I can 😅, very busy right now.