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

[bug] multi-line progressbar shows only one line after printing a warning #272

Closed
TheStarAlight opened this issue Jul 28, 2023 · 2 comments

Comments

@TheStarAlight
Copy link

Hi, I'm using ProgressMeter for my package, the progress is shown in two lines. When my package throws a warning using @warn, the progress would only show the latter line...

Here's an example, while in this example only the former one is shown... very weird...

using ProgressMeter
prog1 = ProgressUnknown(dt=0.2, desc="Launching electrons and collecting ...", color = :cyan, spinner = true)
prog2 = Progress(100; dt=0.2, color = :cyan, barlen = 25, barglyphs = BarGlyphs('[', '●', ['◔', '◑', '◕'], '○', ']'), showspeed = true, offset=1)
for i in 1:100
    sleep(0.1)
    if i==1
        @warn "Some warning"
    end
    next!(prog1);next!(prog2)
end

Using Julia 1.8.5 and ProgressMeter 1.7.2
Paste it in the REPL and run it once, the first time both lines are shown, while if you run the loop again, the latter line disappears...😂

Thank you for your attention! This package is really useful to me, I'll be grateful if you can help!😋

@MarcMush
Copy link
Collaborator

when I try to reproduce your example, both progressmeters are always printed but the next print will overwrite the second one (in the repl, the next julia>)
this is because prog1 is a ProgressUnknown so it doesn't know it's finished
this will be fixed if you add finish!(prog1)

I didn't see any problem with @warn, the behavior is the same for me when commenting in out

@TheStarAlight
Copy link
Author

@MarcMush Thank you for help 🥳! It has been five months and the details are already vague to me. I just tested in my julia 1.9 and everything is fine. Thank you very much!

Btw, I noticed that the introduction of the offset param is missing in the readme, and I think that adding a section which describes how to display multiple progressbars might be helpful :D

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