console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.22k stars 238 forks source link

Progress bar not showing with wide_bar on Windows #505

Closed AronParker closed 1 year ago

AronParker commented 1 year ago

OS: Windows 11 22H2 Rust version: stable-x86_64-pc-windows-msvc (1.66.0 (69f9c33d7 2022-12-12))

Steps to reproduce:

Run cargo run --example download

Expected behavior:

A progress bar is drawn that dynamically expands depending on the terminal's width:

[00:00:05] [######>-------------] 71.95 MiB/220.52 MiB (11.4s)

Actual behaviour:

Progress bar is empty: ⠉ [00:00:01] [] 17.88 MiB/220.52 MiB (15.0s)

I tried Windows Terminal and also the built-in IntelliJ terminal window, but neither of them work properly. Is this a known issue?

AronParker commented 1 year ago

I traced the error back to this line: https://github.com/console-rs/indicatif/blob/main/src/draw_target.rs#L113

for me term.size() returns (308, 18), and it's taking the height for the width

djc commented 1 year ago

I see you already filed an issue against console, so I think this issue can be closed? Thanks for investigating!

AronParker commented 1 year ago

Yes this issue should be closed. You're welcome! Great job on the library.