Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Fwd: Re: PATCH: _pids (add too much matches)



Alexandre Duret-Lutz sent me this:

> 
> mars:205> zsh -f
> mars% autoload compinit; compinit -D
> mars% cat & cat & cat &
> [1] 9464
> [2] 9465
> [3] 9466
> mars% 
> [1]  + suspended (tty input)  cat
> mars% 
> [2]  + suspended (tty input)  cat
> mars% 
> [3]  + suspended (tty input)  cat
> mars% kill 94<TAB>
>   9452 pts/7    S  0:01 zsh -f                                                 
>   9464 pts/7    T  0:00 cat                                                    
>   9465 pts/7    T  0:00 cat                                                    
>   9466 pts/7    T  0:00 cat                                                    
> 9466                                 <--- ???
> mars% kill 946<TAB>
> 9464  9465  9466                     <--- no more process list ?
> 
> 
> set -x showed that _pids added more matches than descriptions.

... and most of the patch below (I /think/ this was sent to the list,
at least I didn't receive it from there).

Only the `command' prefixes are from me.

Bye
 Sven

--- oldcompletion/Builtins/_pids	Mon Nov 22 11:40:05 1999
+++ Completion/Builtins/_pids	Tue Nov 23 09:12:47 1999
@@ -17,11 +17,11 @@
 (( $#listargs )) || listargs=( "$args[@]" )
 
 if _style processes verbose; then
-  list=("${(@Mr:COLUMNS-1:)${(f@)$(ps $listargs 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*${~match}}")
+  list=("${(@Mr:COLUMNS-1:)${(f@)$(command ps $listargs 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*${~match}}")
   desc=(-ld list)
 else
   desc=()
 fi
 
 compadd "$expl[@]" "$@" "$desc[@]" - \
-    ${${${(M)${(f)"$(ps $args 2>/dev/null)"}[2,-1]:#*${~match}}## #}%% *}
+    ${${${(M)${(f)"$(command ps $args 2>/dev/null)"}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]#*${~match}}## #}%% *}

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author