Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Preventing sorting in completers
- X-seq: zsh-workers 18844
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Preventing sorting in completers
- Date: Sun, 13 Jul 2003 18:17:10 +0000
- In-reply-to: <87wuenkuod.fsf@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <87wuenkuod.fsf@xxxxxxxxxxxxxxxx>
On Jul 12, 7:49pm, Philippe Troin wrote:
}
} zstyle ":completion:*:processes" command \
} 'ps -u $UID -o ''pid tty s args'' --forest'
Hmm. When I try to use that set of "ps" arguments, I get no completions
at all. Some investigation reveals that "ps" is giving
ERROR: TTY could not be found.
However, assuming that it's working for you ...
} The problem is that the completion frameworks show the process list
} sorted by PID. How can I prevent that and get the process list in the
} order it was returned by ps (so that --forest makes sense).
You need to edit the _pids function and change the line
_wanted processes expl 'process ID' compadd "$@" "$desc[@]" "$all[@]" -a pids && ret=0
To
_wanted -V processes expl 'process ID' compadd "$@" "$desc[@]" "$all[@]" -a pids && ret=0
Bonus points for making use of the "sort" style and submitting a patch ...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author