raboof / nethogs

Linux 'net top' tool
GNU General Public License v2.0
3.12k stars 285 forks source link

UI enhancement suggestion #103

Open rickan54 opened 7 years ago

rickan54 commented 7 years ago

On my system, Ubuntu Studio, 16.04, Chromium Browser runs with the command line:

/usr/lib/chromium-browser/chromium-browser --ppapi-flash-path=/usr/lib/adobe-flashplugin/libpepflashplayer.so --ppapi-flash-version --enable-pinch

which the UI shortens from the left, which makes sense when the command line has no arguments and the most relevant portion is on the right, but in this case, in an 80 column terminal window, the most relevant portion is eliminated.

So I suggest that when the command line won't fit on a line in the UI and there are options and/or arguments, as in this case, it makes more sense to shorten the line from the right., and then, if all the command line arguments/options are eliminated, shorten from the left.

raboof commented 7 years ago

That would make sense in this case. When the command is an interpreter (like 'pyhon' or 'java') the parameters are actually useful. Perhaps we'd want to allow scrolling like in htop?

Anyway, contributions improving in this area certainly welcome!

rickan54 commented 7 years ago

I had not thought of that case.

  1. And in that case what's most relevant is probably the first argument so if the first argument does not begin with -, then use the second space as the point at which to switch from shortening on the right to shortening on the left.
  2. It might also make sense to remove path elements on the left until only the base name of the command remains, and then shorten on the right until the line fits.
  3. I'd be happy if only the base name of the command were displayed always. Maybe displaying the full path could be an option for the user to turn on if necessary to find the command. In this case shortening of the command line would only be done on the right, and if the full command path does not fit, then the user stretches the terminal window until it does (what I've been doing).

I don't feel like it's worth (my work) adding scrolling(, but I'd be happy if someone else did it).

I've been thinking of doing this work (as I've described it, favoring option 3). We'll see. I won't clone the repository until I can get to free Inet this weekend. I live in the fringe with limited service.

raboof commented 7 years ago

Actually arguments aren't usually shown (though that is a wish, see #23) - chromium does something special there that makes the parameters show up.

I'm OK with truncating from the right instead of from the left - indeed introducing more subtle logic seems confusing and error-prone.