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

Re: Preventing sorting in completers



Peter Stephenson wrote:

> Bart Schaefer wrote:
> > On Jul 12,  7:49pm, Philippe Troin wrote:
> > } 
> > } zstyle ":completion:*:processes" command \
> > }   'ps -u $UID -o ''pid tty s args'' --forest'
> > 
> > Hmm.  When I try to use that set of "ps" arguments, I get no completions
> > at all.  Some investigation reveals that "ps" is giving
> > 
> > ERROR: TTY could not be found.
> 
> My guess is your system is using stdout to decide what the tty is, which
> is explicitly closed.  Try using 1>&2 on the ps command line.  (Or
> something gets closed.  Is it stdin?  Anyway, reopen it.)

I just looked at this, and I get the same error just by running

    ps -o pid tty s args

which is effectively what's getting run above.  I believe that -o
requires *one* argument, with either space or comma separated fields:

    ps -o 'pid tty s args'

or

    ps -o pid,tty,s,args

both of which succeed, and print out a perfectly decent process listing.

I would guess that the double single quotes that Philippe is using
should probably be single quotes escaped by backslashes, or double
quotes, or just using commas to separate them.

My version of ps, on Linux, is 2.0.10.

Danek



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