From 45aa8feef656804b252ddb0d4b73ca944229e606 Mon Sep 17 00:00:00 2001 From: Thomas Faughnan Date: Tue, 20 Sep 2022 18:30:28 -0400 Subject: [PATCH] ps.sh: fix ps arguments to work for busybox 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 --- save_command_strategies/ps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save_command_strategies/ps.sh b/save_command_strategies/ps.sh index 544426c..15bb5aa 100755 --- a/save_command_strategies/ps.sh +++ b/save_command_strategies/ps.sh @@ -11,7 +11,7 @@ exit_safely_if_empty_ppid() { } full_command() { - ps -ao "ppid command" | + ps -ao "ppid,args" | sed "s/^ *//" | grep "^${PANE_PID}" | cut -d' ' -f2-