gazorby / fifc

🐠 Configurable fzf completions for fish shell
MIT License
142 stars 9 forks source link

cannot show process on mac #13

Closed kenchou closed 2 years ago

kenchou commented 2 years ago

Describe the bug

❯ kill ps: illegal option -- -
usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-g grp[,grp...]] [-u [uid,uid...]]

System (please complete the following information):

gazorby commented 2 years ago

Hi @kenchou!

Are you on the latest fifc? Can you run fisher update gazorby/fifc and test if it still happens?

kenchou commented 2 years ago

It's latest. I'm first install. problem is here: https://github.com/gazorby/fifc/blob/main/conf.d/fifc.fish#L26 The options of ps on mac os (BSD) are difference

from man ps

     -o      Display information associated with the space or comma separated list of keywords specified.  Multiple keywords
             may also be given in the form of more than one -o option.  Keywords may be appended with an equals (‘=’) sign and
             a string.  This causes the printed header to use the specified string instead of the standard header.  If all
             keywords have empty header texts, no header line is written.
Linux Mac OS memo
--format pid,command -o pid,command option -o both available on linux/mac
--no-headers -o pid=,command= append = to column name, both available on linux/mac
gazorby commented 2 years ago

Oh I see, thanks pointed that out.

So ps -ax -o pid=,command= should give the desired output

kenchou commented 2 years ago

Yes, I'm tried it. seems fine both on mac and linux

fifc \
    -n 'test "$fifc_group" = processes' \
    -s 'ps -ax -o pid=,command='