strom/fish-misc
Archived
1
0
Fork 0
This repository has been archived on 2023-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
fish-misc/functions/fkill.fish

17 lines
344 B
Fish

# vim: ft=fish ts=4 sw=4 noet
function fkill
command ps -u $USER -o "pid,ppid,etime,stat,tname,cmd" --no-headers | command fzf -m | while read -l pid _
set pids $pids $pid
end
if [ -z $pids ]
return 1
end
if string match --quiet --regex --invert '\D' $argv[1];
kill $argv[1] -- $pids
else
kill -- $pids
end
return $status
end