Skip to content
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

Odd behavior when ProgressBar::printlning lengthy messages #591

Open
matheus-consoli opened this issue Sep 21, 2023 · 2 comments
Open

Odd behavior when ProgressBar::printlning lengthy messages #591

matheus-consoli opened this issue Sep 21, 2023 · 2 comments

Comments

@matheus-consoli
Copy link

When trying to println lengthy messages indicatif forces the terminal to "scroll up" and stop truncating the messages.

To reproduce:

use std::{time::Duration, thread};

use indicatif::ProgressBar; // prepare-0.17-7

fn main() {
    let bar = ProgressBar::new(1);
    bar.set_style(indicatif::ProgressStyle::default_bar().template("{spinner}").unwrap());
    bar.enable_steady_tick(Duration::from_millis(100));

    let mut size = 300;
    loop {
        let msg = "0123456789".repeat(size);
        bar.println("-------");
        bar.println(msg);
        size += 10;
        thread::sleep(Duration::from_millis(500));
    }
}

Recording:

recording.mp4
@matheus-consoli
Copy link
Author

I'm using the unreleased branch (prepare-0.17-7) - when I use the latest released version (0.17.6) it panics

@djc
Copy link
Collaborator

djc commented Sep 22, 2023

Sorry for the issue! Do you know if this is a regression from some earlier version?

I'm not sure I fully understand what the current behavior is, nor how you would expect it to behave in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants