Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh pid completion
- X-seq: zsh-workers 38510
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Marko Myllynen <myllynen@xxxxxxxxxx>
- Subject: Re: zsh pid completion
- Date: Tue, 17 May 2016 18:48:24 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=rvYdzBo2Hl0mYy5pjZ56Hdj6rlg3Fixn9wx+kVdsTkw=; b=ADR6X0ZSQstgd+cWydkMPVYXUH7MLOY4QkDZppOLCawLhg/OmXVShLwNmKZ1mEhszI GH6gNGxDHgB9dBjCnVXsG/nZYzNLkqlml79ZEZM/uGwrMfCxfvG/vMmVftRDYEJYC4yW YjMqaMFuHa1XqXBeyZIcGG5sjBiMvK3FieM5sm+isabBHG6+yIx3fWrwilRLUY9upxmb JOaTdFeEyB2ockhbf1DDSMP+6WtHCyz18aB/xji/66mQXJnYdvdQphsnuC8VvxY1ZEPl +Cc2/hqJigxhgGqXRHN55RWcO9Hek1o+6zL14wZLE3KuEys8DuJJp9DgV+J07a/Fwtpy edRQ==
- In-reply-to: <573AF76D.2010106@redhat.com>
- 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
- References: <573AF76D.2010106@redhat.com>
On Tue, May 17, 2016 at 12:50 PM, Marko Myllynen <myllynen@xxxxxxxxxx> wrote:
> Hi,
>
> I see that _pids completion offers only a very limited subset of the
> running pids (even by the same user). For example, if I launch a command
> on a terminal its PID is not included in completion alternatives on
> another terminal. Also, when root, in some cases it might be beneficial
> to offer also non-root PIDs (perhaps this could be configurable).
>
> Is there some reason for this limited approach? (I'm not sending any
> patches yet, I'm afraid with ps(1) portability might be a bit tricky.)
No need for a patch, you can just set a style to run whatever ps
command you like to generate the matches, i use:
zstyle ':completion:*:processes' command 'ps ax -o
user,pid,nice,%cpu,%mem,vsz,rss,tname,stat,start,time,command
--sort=-%cpu'
These are also possible
zstyle ':completion:*:processes' command 'ps aux'
zstyle ':completion:*:processes' command 'ps --forest -A -o pid,user,cmd'
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author