franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
766 stars 70 forks source link

Did not work on Mac OS (11.4): ps: unsupported exe keyword #109

Closed shagohead closed 3 years ago

shagohead commented 3 years ago

On Mac OS 11.4 (don't know about ps in previous Mac OS releases) exe keyword not supported for -o option.

ps: exe: keyword not found
ps: no valid keywords; valid keywords:
test: Expected a combining operator like '-a' at index 3
! %cpu %mem acflag acflg args blocked caught comm command cpu cputime etime f flags gid group ignored inblk inblock jobc ktrace ktracep lim login logname lstart majflt minflt msgrcv msgsnd ni nice nivcsw nsignals nsigs nswap nvcsw nwchan oublk oublock p_ru paddr pagein pcpu pending pgid pid pmem ppid pri pstime putime re rgid rgroup rss ruid ruser sess sig sigmask sl start stat state stime svgid svuid tdev time tpgid tsess tsiz tt tty ucomm uid upr user usrpri utime vsize vsz wchan wq wqb wql wqr xstat = tmux
                                                                                                                                                                                                                                       ^
~/.config/fish/conf.d/done.fish (line 115):
            and test ! (basename (ps -o exe= -p $tmux_fish_ppid)) = "tmux"
                ^
in function '__done_is_tmux_window_active'
        called on line 146 of file ~/.config/fish/conf.d/done.fish
in function '__done_is_process_window_focused'
        called on line 206 of file ~/.config/fish/conf.d/done.fish
in function '__done_ended'
in event handler: handler for generic event 'fish_prompt'
aystroganov commented 3 years ago

Similar issue is happening on Pop!_OS 20.04, when I end an ssh session while in tmux:

Connection to XXX closed.
error: unknown user-defined format specifier "exe"

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
basename: missing operand
Try 'basename --help' for more information.

Using done.fish v1.16.2

aystroganov commented 3 years ago

I just looked up the output format specifiers for my version of ps, and there is no exe, however there are args and comm (see https://linuxcommand.org/lc3_man_pages/ps1.html), not sure which one it should be.

jaideeprana commented 3 years ago

Hey,

Any update on this? I am also encountering the same issue.

hisnawi commented 3 years ago

Is Sam's fix going to be incorporated in this repo? Is there an ETA for the new release with the fix?

franciscolourenco commented 3 years ago

Fixed in v1.16.3. Sorry for the delay