Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ps http<tab> completion to get procees ID
- X-seq: zsh-users 20381
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: ps http<tab> completion to get procees ID
- Date: Fri, 31 Jul 2015 22:52:21 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=9+H0kL7C31wdfQRxXPtyaVTEyzg=; b=dEXB65 is9QIysrutHs3iNpuyiKuyaRdRMeHveRRSMf+219o4fT/4x03caw8sa6hhFtVNf1 XwiwvliAh3SVoKx7jHj4vzq0z0UvXsezF/ZOz1VzvQWMdiJ7XRyLHp7ZY9kAABxi 2V9+dTsf5hMMetRaSwbtky31qbveA521SP79c=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=9+H0kL7C31wdfQRxXPtyaVTEyzg=; b=Wh8Lw IxyCFDbKB/FngC38E+FdxPt3rxgzG9IFjUdGiW5Pdy2BTq2/RQzRTrolWJ8PgLhj JSMvvZqTsvDKfptqmLP3ghhCQTX6LdXv0/3Q/vRVDUaYkoIBnxmgQ5mDYsoUaYuy q4/4gkVAUD/U+6GLe+H+rP4Dro8gziA1ASX3bk=
- In-reply-to: <26693.1438273017@thecus.kiddle.eu>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <XnsA4E58A28DA190davidrayninfocouk@80.91.229.13> <150728121925.ZM8124@torch.brasslantern.com> <20150730154201.GD2264@tarsus.local2> <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!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author