ctongfei / progressbar

Terminal-based progress bar for Java / JVM
http://tongfei.me/progressbar/
MIT License
1.07k stars 102 forks source link

Is it possible to wait for the drawing of the bar to complete? #130

Open MagnusErikssonAB opened 2 years ago

MagnusErikssonAB commented 2 years ago

When using the "imperative style" I sometimes end up with the progress bar stop drawing at say 10% - is this due to the background thread terminating when the block is exited and if so is there a way to wait for the drawing of the bar to finish before exiting the block? image

ctongfei commented 2 years ago

Are you using the try (Progressbar pb = ...) pattern? If yes, it should stop properly. If not, you can use pb.close() to manually finish the progress bar, forcing it to draw one last time.