-
Notifications
You must be signed in to change notification settings - Fork 246
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
MultiProgress:println
doesn't behave correctly when no progress bars have been added yet
#447
Comments
FYI this is related to #442 I think |
Seems reasonable. |
FWIW, this is what it manifests as: fn main() {
let progress = indicatif::MultiProgress::new();
progress.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n").unwrap();
progress.println("bbb\n").unwrap();
} |
I had some fixes for this issue in #518 ; but they bitrotted before the end of code review; and I don't have any time to allocate it any longer. Anyone looking at this, feel free to take over #518; as it's probably one rebase away from being able to fix this issue, and I introduced a test there which would easily be able to tell whether the fix actually works :) |
Try this render test:
It fails like this:
The issue is that the underlying
DrawState::draw_to_term
method assumes that the last line to be drawn doesn't contain a newline. This is true when progress bars are involved, but not true when just callingMultiProgress:println
with no progress bars.I think we need to add some extra logic to
draw_to_term
so that it behaves differently when no progress bars are present.The workaround I am using right now is to just use
MultiProgress::suspend
and then useeprintln!
inside that.The text was updated successfully, but these errors were encountered: