-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Description
On macOS, the plugin fails to detect SSH sessions when splitting panes. New panes open on the local machine instead of SSHing to the remote server.
Root Cause
The get_child_cmds() function in scripts/tmux-ssh-split.sh uses \s in the awk regex pattern (line 273):
ps -o ppid=,pid=,command= | \
awk '/^\s*'"${ppid}"'\s+/ { $1=""; print $0 }'macOS uses BSD awk, which does not support \s (Perl-style regex). The pattern silently fails to match, so no SSH process is ever found.
Reproduction
# On macOS, this returns nothing:
echo " 6485 6512 ssh" | awk '/^\s*6485\s+/ { print }'
# But this works:
echo " 6485 6512 ssh" | awk '/^[[:space:]]*6485[[:space:]]+/ { print }'Fix
Replace \s with the POSIX character class [[:space:]]:
ps -o ppid=,pid=,command= | \
awk '/^[[:space:]]*'"${ppid}"'[[:space:]]+/ { $1=""; print $0 }'This works on both Linux (GNU awk) and macOS (BSD awk).
Environment
- macOS (Darwin)
- BSD awk (default on macOS)
- tmux-ssh-split installed via TPM
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels