about summary refs log tree commit diff
path: root/Completion/Builtins/_kill
blob: 4f8c1db6dc6c48f884caaff349b0dfe81197fe44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#compdef kill

local list

if compset -P 1 -; then
  compgen -k "($signals[1,-3])"
else
  local ret=1

  compgen -P '%' -j && ret=0
  list=("$(ps 2>/dev/null)")
  compgen -y '$list' -s '${${${(f)"$(ps 2>/dev/null)"}[2,-1]## #}%% *}' && 
    ret=0

  return ret
fi