console-rs / indicatif

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

Resetting the time elapsed does not also reset the ETA #536

Closed afontenot closed 1 year ago

afontenot commented 1 year ago

I think this is just an oversight, but I want to confirm that instead of sending a PR without justification.

I can see how it would make sense to want to reset the ETA but not the time elapsed. E.g. maybe progress stalled for a while, or something, and you want a clean estimate without resetting the time elapsed counter. On the other hand, I can't imagine wanting to reset the time elapsed for the whole progress bar without expecting that to also reset the ETA. It doesn't make very much sense for the progress bar to say it's only been active 1 minute, when the ETA / bitrate is based on data from the last two minutes.

My thinking is that the Reset::Elapsed mode should also reset ::Eta, but not vice versa, and that both of these should be independent of Reset::All (because you only want to recreate the whole progress bar in specific situations).

chris-laplante commented 1 year ago

Your reasoning makes sense to me; I think it was just an oversight.

djc commented 1 year ago

Agreed. Want to submit a PR?