Closed vvbandeira closed 4 years ago
Sure. Can you open a PR?
BTW shouldn't it be ps -o command= "$child_pid"
?
Using both cmd
and command
will output the full command twice on Linux.
I am not 100% on which is the most compatible across implementations of ps
. Right now I only have access to a macOS machine, but from your comment using just command=
should work for macOS and GNU/Linux.
If you think is best, maybe you can add a if
check for MacOS:
if [[ "$(uname)" == "Darwin" ]]
# use command=
else
# use cmd=
fi
I leave that to your discretion as both would solve the issue. If you create a commit with the option you are more comfortable with that would be best. Thanks.
Why don't you open a PR? :)
Hi, I had an issue when using the plugging in MacOS.
The root cause is the line below. The keyword
cmd=
is not recognized by the BSD version ofps
. For details see the FreeBSD manpage.https://github.com/pschmitt/tmux-ssh-split/blob/0465ed17f65d3e2350a30e282f980e5d4e264d18/scripts/tmux-ssh-split.sh#L43
A possible fix is to add
command=
to the keyword list as follows:child_cmd="$(ps -o cmd=,command= "$child_pid")"
Thanks for the plugin!