hishamhm / htop

htop is an interactive text-mode process viewer for Unix systems. It aims to be a better 'top'.
GNU General Public License v2.0
5.84k stars 581 forks source link

Suggestion/request: Ellipsis in long path names #910

Open cw1nte opened 5 years ago

cw1nte commented 5 years ago

If full paths are being shown, as I usually do, then the very long paths in some OSen (e.g. macOS)

/System/Library/StagedFrameworks/Safari/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent

are not very usefully displayed. More useful (where path_len > available_len) would be perhaps first 70%*available_len ... last 30%*available_len so maybe /System/Library/StagedFrameworks/Safari/WebKit.fra....acOS/com.apple.WebKit.WebContent

Where there are many long parameter strings, e.g.

/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared

there is a similar problem. The priority of path vs params is beyond me to hope to guess, in general across all systems & useages, but maybe 50% of available_len for each and then apply the ellipsis ideas as in the path only case? Perhaps I'd prefer more params as the path can usually be found via locate, find and other tools.

Does this recalculate and change when scrolling? ideally, if the performance impact is not too large, at least when scroll has stopped for a suitable amount of time! Thanks for your consideration....