tarka / xcp

An extended `cp`
GNU General Public License v3.0
747 stars 24 forks source link

Progress bar is too large #13

Closed ellishg closed 4 years ago

ellishg commented 4 years ago

When copying, the progress bar is longer than the size of my terminal and it overflows to the next line. This is what I get when I copy a file.

$ cargo run A.mp4 B.mp4
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/xcp A.mp4 B.mp4`
[00:00:00] [--------------------------------------------------------------------[00:00:00] 
[#############>------------------------------------------------------[00:00:00] 
[####################>-----------------------------------------------[00:00:00] 
[###########################>----------------------------------------[00:00:00] 
[########################################>---------------------------[00:00:00] 
[###############################################>--------------------[00:00:00] 
[######################################################>-------------[00:00:00] 
[#############################################################>------[00:00:00] 
[####################################################################[00:00:00] 
[####################################################################[00:00:00] 
[###############################################################################
#] 751.60MB/751.60MB (0s)
tarka commented 4 years ago

Thanks for the report. Can you tell me the OS, terminal, and size of the terminal window?

ellishg commented 4 years ago
$ uname -r
5.6.3-arch1-1
$ gnome-terminal --version
# GNOME Terminal 3.36.1.1 using VTE 0.60.1 +BIDI +GNUTLS +ICU +SYSTEMD
$ tput cols
80
$ tput lines
24
tarka commented 4 years ago

Confirmed on Debian; I'll take a look.

ellishg commented 4 years ago

You can use wide_bar here https://github.com/tarka/xcp/blob/41702c137af9e1e7e61b237733863bb44ac81480/src/progress.rs#L165

I can make a pull request.