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

user-sensitive kill completion in conjunction with sudo



I must admit that the zsh completion system is something I've never
taken time to understand as well as I should.  I'm wondering if I can
get kill to complete only processes that I can send a signal to in the
current context, so

% kill ^D

shows all processes launched by me, and

% sudo kill ^D

shows all process.  It would be even better if

% sudo -u someone kill ^D

showed processes launched by 'someone'.  Currently, I use

zstyle ':completion:*:*:kill:*' command 'ps -u$USER -o pid,%cpu,tty,cputime,cmd'

Is there some easy (or even difficult) way to modify this to handle
the user 'kill' will be executed as?

~Matt



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