-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Option to leave progress bar visible after finished #75
Comments
Great! Would happily accept PR with this |
Can I try this one for hacktoberfest? |
@ibraimgm of course! |
@vsekhar can you giv me more details or a demo where I can better understand your problem? On all the demos, the progress bar remain visible after the run. |
Wait, but... Line 210 in 2ec720b
|
Confirming that bar := progressbar.NewOptions(100,
progressbar.OptionClearOnFinish(),
) |
@vsekhar Does this solve your issue? |
If my program logs after the bar finishes, then depending on the cursor and output stream (I use go-ansi), the bar either disappears or gets merged/garbled with the next log message. I think the issue is a lack of newline once the bar finishes. I think you need something like if !p.config.clearOnFinish {
if _, err := io.WriteString(c.writer, "\n"); err != nil {
return err
}
} inserted here. |
Is this issue still open?. If it is can I pick it up? |
@vidu171 Its open, go ahead! |
Hi, I am not able to recreate this issue my bar is still visible after and it doesn't get merged/garbled with the next log message. |
I was also having this issue, it seems the problem happens with p.config.userANSICodes is set to true only, since it clears the line after it was re-rendered for finish. I think simple removing lines 628-633 should solve the issue: https://github.com/schollz/progressbar/blob/master/progressbar.go#L628 Notice that when not using ANSI Codes, the clearing happen before teh re-rendering, here: https://github.com/schollz/progressbar/blob/master/progressbar.go#L609 |
Simple 0.5 line fix, at least for the case with config.useANSICodes: #140 |
Fixes case where bar was being incorrectly cleared on finished #75
Option to leave progress bar onscreen when finished. Useful for seeing counts and rates after completing a run.
The text was updated successfully, but these errors were encountered: