Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: kill _pids completion - arguments for ps



Sagar Shah wrote:
> 
> One of the alternatives for completing the kill command is a list of
> pids generated by the _pids function.
> 
> _pids calls the command 'ps' which just returns the child processes of
> the shell.
> 
> I'd actually prefer to return all processes owened by the current user
> (ps -u $LOGNAME on linux) and i get the impression there's a way to

Wherever the completion system runs a command like ps to generate
matches, it checks the `command' style so that you can specify a
replacement command. So pick your command and set the style:

e.g.:

zstyle ':completion:*:processes' command 'ps -o pid,s,nice,stime,args'

If you only want to affect the kill command then:

zstyle ':completion:*:kill:*:processes' command 'ps -o pid,s,nice,stime,args'

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author