From: Mikael Magnusson <mikachu@gmail.com>
To: Marko Myllynen <myllynen@redhat.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: zsh pid completion
Date: Tue, 17 May 2016 18:48:24 +0200 [thread overview]
Message-ID: <CAHYJk3SDb5H9wQ8fmbwegTUYMS5xbQnqEQoVn0oWVBZr_UYJLA@mail.gmail.com> (raw)
In-Reply-To: <573AF76D.2010106@redhat.com>
On Tue, May 17, 2016 at 12:50 PM, Marko Myllynen <myllynen@redhat.com> 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
next prev parent reply other threads:[~2016-05-17 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 10:50 Marko Myllynen
2016-05-17 16:48 ` Mikael Magnusson [this message]
2016-05-19 21:14 ` Daniel Shahaf
2016-05-20 7:41 ` Marko Myllynen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHYJk3SDb5H9wQ8fmbwegTUYMS5xbQnqEQoVn0oWVBZr_UYJLA@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=myllynen@redhat.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).