about summary refs log tree commit diff
path: root/Completion/Builtins/_kill
blob: 26f6bf5cd2c76d2966633adf2ec9e3b7725c3f62 (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
  compadd $signals[1,-3]
else
  local ret=1

  compgen -P '%' -j && ret=0
  list=("${(@Mr:COLUMNS-1:)${(f)$(ps ${compconfig[ps_listargs]:-$compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
  compadd -y list - ${${${(f)"$(ps $compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} &&
    ret=0

  return ret
fi