zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-users@zsh.org
Subject: Re: ps http<tab> completion to get procees ID
Date: Fri, 31 Jul 2015 22:52:21 +0000	[thread overview]
Message-ID: <20150731225203.GA2054@tarsus.local2> (raw)
In-Reply-To: <26693.1438273017@thecus.kiddle.eu>

Oliver Kiddle wrote on Thu, Jul 30, 2015 at 18:16:57 +0200:
> Daniel Shahaf wrote:
> > It seems to only complete processes from the current terminal.  For
> > example, if I just do 'ps <TAB>', I get:
> 
> > I guess that's due to _pids running 'ps' without further arguments.
> > Shouldn't the command be configurable?  I'd love to have it show all
> > user processes (or even all processes when sudoed).
> 
> It is configurable. The command style is not specific to kill.
> 
> I'd recommend using tag labels and use the _next_tags widget if you want
> it to pick-up a wider range of processes. Something like the following:
> 
> zstyle ':completion:*:(kill|lsof|ps|ss):*:' tag-order processes:-tty 'processes:-mine:user\ processes' 'processes:-all:all\ processes'
> zstyle ':completion:*:([sl]trace|truss|gcore|gdb):*:' tag-order processes:-mine 'processes:-all:all\ processes'
> case $OSTYPE in
>   *bsd*)
>     zstyle ':completion:*:processes' command 'ps -o pid,ppid,state,start,args'
>     zstyle ':completion:*:processes-mine' command "ps U $EUID -o pid,ppid,state,start,args"
>     zstyle ':completion:*:processes-all' command "ps A -o pid,ppid,state,start,args"
>   ;;
>   *)
>     zstyle ':completion:*:processes' command 'ps -o pid,s,ppid,stime,args'
>     zstyle ':completion:*:processes-mine' command "ps -u $EUID -o pid,s,ppid,stime,args"
>     zstyle ':completion:*:processes-all' command 'ps -e -o pid,s,ppid,stime,args'
>   ;;
> esac

Thank you!


      reply	other threads:[~2015-07-31 22:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 12:34 zzapper
2015-07-28 19:19 ` Bart Schaefer
2015-07-30 15:42   ` Daniel Shahaf
2015-07-30 16:16     ` Oliver Kiddle
2015-07-31 22:52       ` Daniel Shahaf [this message]

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=20150731225203.GA2054@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=zsh-users@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).