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 20372
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: ps http<tab> completion to get procees ID
- Date: Thu, 30 Jul 2015 18:16:57 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1438273019; bh=UmqR1pk2w9kT580o5Rbp2Oq775fqHZMHhfnBYEeDjYA=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=n3nCllhK1YBHOvMhhXxTd4nXdWul2dCUUS1uMhjrZ9Y759WQsbcaex/u7e7fzUHw6/oTg5M5h6r1nxe9LcT2nqtdZLPLQPhiqurldVKEyfhz7HtLkePZAi14Sqq8Mg5nz+KiPaeMNtrYDFLUA2WuYiH4iaCVMfZ57c//F80/WxqnjWFv6uKUOHX+FaMFTa8e8ziaf6cUFycykoICIT9+e8Tu3LsqXkckVrVZ4Lq1uLMDAcRG0EPT2EfluUuRzS2ndsbu/XvAAhSihWyhMw2Axmvv8WJ5a4V1+RgwsweqO/Cmfl1aU8piDRZLrEG/rXQkShNigJgIsFtRErILfEZPFw==
- In-reply-to: <20150730154201.GD2264@tarsus.local2>
- 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>
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
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author