JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
609 stars 251 forks source link

Afterimages of the download progress bar #3923

Open kimikage opened 3 weeks ago

kimikage commented 3 weeks ago

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 %".

https://github.com/JuliaLang/Pkg.jl/blob/78bca42272aac3f3b1f9d621a2f995babfc23f2e/src/PlatformEngines.jl#L275-L279

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 commented 3 weeks ago

There's also an overprinting bug around this code somewhere https://github.com/JuliaLang/Pkg.jl/issues/3581

kimikage commented 3 weeks ago

Fixing the number of characters in the percentage would solve this problem. E.g., use "%5.1f %%" https://github.com/JuliaLang/Pkg.jl/blob/78bca42272aac3f3b1f9d621a2f995babfc23f2e/src/MiniProgressBars.jl#L51

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

kimikage commented 3 weeks ago

This is off-topic, but the comment below has not been updated and has multiple typos. https://github.com/JuliaLang/Pkg.jl/blob/78bca42272aac3f3b1f9d621a2f995babfc23f2e/src/MiniProgressBars.jl#L78-L89