about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Zsh/Command/_kill6
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a03c646dd..3686a1c52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-08-13  Oliver Kiddle  <opk@zsh.org>
 
+	* 32925: Completion/Zsh/Command/_kill: complete process groups,
+	partly as a way to suppress insertion of ambiguous PID prefix
+
 	* 32893: Completion/Unix/Type/_pids: move use of _call_program
 	inside the _tags loop to allow processes to be separated
 
diff --git a/Completion/Zsh/Command/_kill b/Completion/Zsh/Command/_kill
index 5e52a99de..b9dfde3f0 100644
--- a/Completion/Zsh/Command/_kill
+++ b/Completion/Zsh/Command/_kill
@@ -1,6 +1,7 @@
 #compdef kill
 
 local curcontext="$curcontext" line state ret=1
+typeset -A opt_args
 
 _arguments -C \
   '(-s -l 1)-n[specify signal number]:signal number' \
@@ -10,9 +11,12 @@ _arguments -C \
   '*:processes:->processes' && ret=0
   
 if [[ -n "$state" ]]; then
+  local pgrp='process-groups:: _wanted '
+  [[ -n "$opt_args[(i)-[ns]]${${(@)line:#--}}" && -prefix - ]] && pgrp+='-x '
+  pgrp+="process-groups expl 'process-group' compadd - 0"
   _alternative \
     'processes:: _pids' \
-    'jobs:: _jobs -t' && ret=0
+    'jobs:: _jobs -t' $pgrp && ret=0
 fi
 
 return ret