Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps.sh: fix ps arguments to work for busybox #455

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

tfaughnan
Copy link
Contributor

Use the format specifier 'ppid,args' instead of 'ppid command'. POSIX allows either spaces or commas as separators, but busybox only allows commas. Furthermore, args is recognized by POSIX while command is not. On implementations of ps that do recognize command, it is simply an alias for args, e.g. Debian and FreeBSD.

Use the format specifier 'ppid,args' instead of 'ppid command'. POSIX
allows either spaces or commas as separators, but busybox only allows
commas. Furthermore, 'args' is recognized by POSIX[0] while 'command' is
not. On implementations of ps that do recognize 'command', it is simply
an alias for 'args', e.g. Debian[1] and FreeBSD[2].

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
[1]: https://manpages.debian.org/bullseye/procps/ps.1.en.html
[2]: https://www.freebsd.org/cgi/man.cgi?query=ps
@bruno-
Copy link
Member

bruno- commented Sep 21, 2022

I think we should merge this change. The ps strategy is the default approach for saving commands.
Do you think this could break any of the existing systems?

@tfaughnan
Copy link
Contributor Author

I doubt it would break existing systems. I've tested (on an Arch Linux box) that it works for the ps provided by procps-ng, which is the default on many Linux distros. And the BSDs seem to agree with POSIX too judging by their man pages. Of course I could just install a non-busybox ps on my Alpine Linux system, but this change seems better to me.

@bruno- bruno- merged commit 88297b4 into tmux-plugins:master Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants