updated _ssh_or_mosh_args()

relaxed the regex to accommodate for renamed ssh clients and to ignore the command if supplied
This commit is contained in:
Gregory Pakosz 2021-11-02 14:21:55 +01:00
parent 1ef9b68d80
commit c6bab99f05
1 changed files with 1 additions and 1 deletions

View File

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