your-tools / pycp

cp and mv with a progress bar
MIT License
147 stars 8 forks source link

Progressbar sometimes too long #29

Closed dmerejkowsky closed 4 years ago

dmerejkowsky commented 4 years ago

Steps to reproduce:

pycp /veeeeeeeeeeeeeeerrrrrrrrrrrrry/looooooooooooooooooong/paaaaaaaaaath/{src,dest}

The problem is that the output of describe_transfer is not guaranteed to take less than the line width, and after that it's too late to know which segment of the line should be truncated

dmerejkowsky commented 4 years ago

Update: this is by design, the very purpose of the describe_transfer is to display both source and destination, reducing the noise as much as possible (hence the arrow and the computation of a common middle part).

So if it is still larger than the terminal size, there's nothing we can do.

This is the exception: all other info must fit on one line, otherwise you get ugly outputs.