fish-shell/share/functions/__fish_complete_proc.fish
Fabian Homborg 60fa9da3a7 Rewrite __fish_complete_proc
- No longer uses sed, sort, uniq, uname
- Stop doing too-clever filtering (e.g. the kernel thread stuff never
- really worked)
- Don't truncate for all OSen, instead just use the (correctly
- truncated) comm field.
2018-11-22 15:23:05 +01:00

8 lines
460 B
Fish

function __fish_complete_proc
# "comm=" means "print comm field with an empty name", which causes the header to be removed.
# On many systems, comm is truncated (e.g. on Linux it's 15 chars),
# but that's okay since commands that accept them as argument also only use those (e.g. pgrep).
# String removes zombies (ones in parentheses) and padding (macOS adds some apparently).
ps -axc -o comm= | string match -rv '\(.*\)' | string trim
end