Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: don't sort processes in _pids
- X-seq: zsh-workers 29205
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: don't sort processes in _pids
- Date: Mon, 9 May 2011 23:57:11 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=1/aWaf+fppOCc4E7gP9LdoMbRgYLyxfLcgCxLvoPNIg=; b=BD/Day/UBzC9U7zk1u01p01nurP63KWxTlXOhrWbUwh/fdX5RuMdpSrPE3MAWHK9NS gASLahlwelwAAJcZFNYycZcUZhMN4eYO6/B6yBEo0OOgpQZ0TKkH+/VZ4iaX1EvhtPzG 1nAQRnuP5CHV4aYzqdIlwOAs8gFya80YewxyY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UXrZCUv6DBkYxFIpmeYhjboK14+jFBlS3boNzGn850yQmViW6z7sqBm1Ujjbh9tWOE Qb6cobWjVLYrv8UdbvgpmwHCpGXM5J+Jb+E2GHwCSWIW9K8AV6B3FH3tSlUnaO7fwN8M kgABUs1NVNNURP24eU4lQXaW2QaIF3c2DBfu4=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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