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

Re: [PATCH] new function to complete names of running process (and three example usage)



On 21 Jun 2018, at 06:41, Jun T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
>Thanks. Do you know 'ps -o comm' truncates the name or not?

Sorry, didn't think to mention. Both comm and args on Solaris use psinfo_t's
pr_psargs, which is limited to 80 bytes. (comm is just args cut off at the first
white-space character.)

From what i can tell, though, DTrace's execname variable (what `dtruss -n`
matches against) seems to use pr_fname, and that's limited to 16 bytes.
Unfortunately ps's fname output is truncated further to 8 bytes for no apparent
reason, so i guess if you wanted dtruss process-name completion to be
semi-accurate on Solaris you might be better off with something like this?

  ${(@M)${(@)${(f)"$( ps -Ao comm= )"}:t}##?(#c1,16)}

dana



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