bash-completion
bash-completion copied to clipboard
killall, pidof: complete executable path
Describe the feature/solution
The completions for killall
and pidof
currently complete process names, but not executable paths, as supported by the
BusyBox, psmisc, SysV Init present on most Linux systems.
Preferably the completion would only match paths starting with /
, since BusyBox, psmisc and SysV Init use the leading /
to distinguish paths from names. It may also be useful to limit matched paths to files with execute permission, since it's unlikely running processes would be non-executable.
Unfortunately, not all versions of killall
and pidof
support path arguments (e.g. FreeBSD killall
). I'm not sure whether it's worth excluding such versions and, if so, how best to do so.
Thanks for considering!
Ack.
If we'd complete paths only when the initial slash was entered by the user, I think that would be kind of enough as users on systems that don't support that are somewhat unlikely to enter the slash.
Another approach we could take is to conditionalize like if _userland GNU; then ...
. That would be cheating a bit, but could work for practical purposes.