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

Afterimages of the download progress bar #3923

Open
kimikage opened this issue Jun 11, 2024 · 3 comments
Open

Afterimages of the download progress bar #3923

kimikage opened this issue Jun 11, 2024 · 3 comments

Comments

@kimikage
Copy link

Afterimages of the download progress bar may be visible.
progress

This is probably due to the redirection. I.e., once the download progress reaches "100.0 %", the actual download restarts from "0.0 %".

(total, now) -> begin
bar.max = total
bar.current = now
show_progress(io, bar)
end

julia> versioninfo()
Julia Version 1.12.0-DEV.706
Commit e7893a1fa4 (2024-06-11 09:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  WORD_SIZE: 64
  LLVM: libLLVM-17.0.6 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

This bug seems to be old and can be traced back to at least Julia v1.6.7.

@IanButterworth
Copy link
Member

There's also an overprinting bug around this code somewhere #3581

@kimikage
Copy link
Author

kimikage commented Jun 11, 2024

Fixing the number of characters in the percentage would solve this problem.
E.g., use "%5.1f %%"

@sprintf "%2.1f %%" perc

Alternatively, a measure to perform line clearing when the value of max changes from the last time would also be effective.

@kimikage
Copy link
Author

This is off-topic, but the comment below has not been updated and has multiple typos.

# Useful when writing a progress bar in the bottom
# makes the bottom progress bar not flicker
# prog = MiniProgressBar(...)
# prog.end = n
# for progress in 1:n
# print_progree_bottom(io)
# println("stuff")
# prog.current = progress
# showproress(io, prog)
# end
#
function print_progress_bottom(io::IO)

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