1
0
Fork 0
mirror of synced 2024-11-17 23:15:35 -05:00

updated _ssh_or_mosh_args() (2), fixes #627

do not try to ignore the command if supplied

parsing the ssh command line is brittle and people sometimes pass
options after user@hostname, e.g.

ssh -p 222 user@hostname -I /usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so
This commit is contained in:
Gregory Pakosz 2023-02-22 23:28:53 +01:00
parent 537b276d74
commit f242584ba3

View file

@ -531,7 +531,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# _ssh_or_mosh_args() {
# case "$1" in
# *ssh*)
# args=$(printf '%s' "$1" | perl -n -e 'print if s/.*?\bssh[\w]*\s*((?:\s+-\w+)*)(\s+\w+)(\s\w+)?/\1\2/')
# args=$(printf '%s' "$1" | perl -n -e 'print if s/.*?\bssh[\w_-]*\s*(.*)/\1/')
# ;;
# *mosh-client*)
# args=$(printf '%s' "$1" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/' -e 's/-[^ ]*//g' -e 's/\d:\d//g')