console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.46k stars 243 forks source link

examples/fastbar.rs rendering is different on Windows git-bash than CMD or PowerShell #634

Closed DBY047 closed 9 months ago

DBY047 commented 9 months ago

I saw a similar behavior on a program I wrote. Whether I use finish or finish_and_clear, printLn! called after is printed on the same line as the progress bar. I saw the same behavior on fastbar example.

Rendering on Command Prompt: image

Redering on git bash image

Also, it looks like wide_bar is not handled the same way on all terminals. I can't find out what to change on my code or on git-bash configuration so wide_bar is rendered wide.

Thanks,

djc commented 9 months ago

Sorry, I won't have time to look into this. Open to reviewing a PR if you figure out why this happens, though!

DBY047 commented 9 months ago

@djc Both issue are caused by GetConsoleScreenBufferInfo in console/mod.rs returning 0.

I found a fix here https://github.com/mintty/mintty/issues/1188#issuecomment-1333257062 that fixes both wide_bar not beeig wide and the printLn! not beeing printed as a new line.

djc commented 9 months ago

Glad you were able to fix it!