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

PATCH: don't sort processes in _pids



I use this style to show processes using the most cpu first when completing pids
zstyle ':completion:*:processes' command 'ps aux --sort=-%cpu'
but it doesn't work, because it gets resorted lexicographically, stop
doing that. As the default output of ps is to sort by pid, I don't
think this makes the uncustomized scenario worse than before.

diff --git a/Completion/Unix/Type/_pids b/Completion/Unix/Type/_pids
index ea5ed79..3f99dfd 100644
--- a/Completion/Unix/Type/_pids
+++ b/Completion/Unix/Type/_pids
@@ -37,7 +37,7 @@ else
   desc=()
 fi

-_wanted processes expl 'process ID' \
+_wanted -V processes expl 'process ID' \
     compadd "$@" "$desc[@]" "$all[@]" -a - pids && ret=0

 if [[ -n "$all" ]]; then


-- 
Mikael Magnusson



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