aguinet / usbtop

usbtop is a top-like utility that shows an estimated instantaneous bandwidth on USB buses and devices.
BSD 3-Clause "New" or "Revised" License
277 stars 45 forks source link

Tabs shouldn't be used for output #31

Open janoskut opened 4 years ago

janoskut commented 4 years ago

The output alignment isn't aligned in all terminals and editors:

Seems to be aligned on github:

Bus ID 0 (Raw USB traffic, all USB buses)   To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
  Device ID 15 :            0.00 kb/s   0.00 kb/s
  Device ID 47 :            0.00 kb/s   0.00 kb/s
  Device ID 48 :            141.75 kb/s 630.75 kb/s
Bus ID 1 (Raw USB traffic, bus number 1)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
Bus ID 2 (Raw USB traffic, bus number 2)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
Bus ID 3 (Raw USB traffic, bus number 3)    To device   From device
  Device ID 47 :            0.00 kb/s   0.00 kb/s
  Device ID 48 :            141.74 kb/s 619.71 kb/s
  Device ID 49 :            0.00 kb/s   0.00 kb/s
Bus ID 4 (Raw USB traffic, bus number 4)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
Bus ID 5 (Raw USB traffic, bus number 5)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
Bus ID 6 (Raw USB traffic, bus number 6)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
Bus ID 7 (Raw USB traffic, bus number 7)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
  Device ID 2 :         0.00 kb/s   0.00 kb/s
  Device ID 8 :         0.00 kb/s   0.00 kb/s
  Device ID 9 :         0.00 kb/s   0.00 kb/s
  Device ID 15 :            0.00 kb/s   0.00 kb/s
  Device ID 16 :            0.00 kb/s   0.00 kb/s
Bus ID 8 (Raw USB traffic, bus number 8)    To device   From device
  Device ID 1 :         0.00 kb/s   0.00 kb/s
  Device ID 2 :         0.00 kb/s   0.00 kb/s
  Device ID 3 :         0.00 kb/s   0.00 kb/s
  Device ID 4 :         0.00 kb/s   0.00 kb/s

Not aligned in terminator or ubuntu terminal: image

Not aligned in Sublime Text: image

mxmilkiib commented 3 years ago

Finding it hard to figure out what's going on;

image

Axel-Jacobsen commented 1 year ago

Interestingly enough, if you build from source you don't get this issue.

I initially did sudo apt install usbtop, and reproduced the issues that we found above. Looking at source code, I thought I could just s/\t/ /g over the repo and be good to go.

After cloning, I tried an initial build just to make sure I wasn't mucking anything up, and when I ran my build, everything was aligned properly.

This is perhaps some linux / compilation thing? I don't know enough about this sort of stuff to say off the top of my head. For reference,

pi@raspberrypi:~/Documents/usbtop $ lsb_release -a 
No LSB modules are available.                   
Distributor ID: Raspbian                        
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11                              
Codename:       bullseye          
mxmilkiib commented 1 year ago

I'm on Arch Linux. usbtop is avaliable to install through the AUR, usbtop and usbtop-git. Both of these are a "build from source" AUR entry. I tried usbtop-git first and that aligns correctly. Then I tried usbtop and that has the problem. I surmise the problem is fixed but there hasn't been a release since.

Axel-Jacobsen commented 1 year ago

Ah! OK that tracks. Cheers!

Luflosi commented 1 year ago

I think this was fixed by #32.

Luflosi commented 1 year ago

@aguinet can you please make a new release?