1
0
Fork 0
mirror of synced 2024-12-21 22:31:06 -05:00

optimized _ssh_or_mosh_args() by deferring calls to external programs

This commit is contained in:
Gregory Pakosz 2019-09-26 13:45:35 +02:00
parent 03d9514071
commit 20fa97e310

View file

@ -546,10 +546,14 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# }
#
# _ssh_or_mosh_args() {
# args=$(printf '%s' "$1" | awk '/ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { $1 = $2 = $3 = ""; print $0; exit }')
# if [ -z "$args" ]; then
# args=$(printf '%s' "$1" | grep 'mosh-client' | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/' -e 's/-[^ ]*//g' -e 's/\d:\d//g')
# fi
# case "$1" in
# *ssh*)
# args=$(printf '%s' "$1" | awk '/ssh/ && !/vagrant ssh/ && !/autossh/ && !/-W/ { $1 = $2 = $3 = ""; print $0; exit }')
# ;;
# *mosh-client*)
# args=$(printf '%s' "$1" | sed -E -e 's/.*mosh-client -# (.*)\|.*$/\1/' -e 's/-[^ ]*//g' -e 's/\d:\d//g')
# ;;
# esac
#
# printf '%s' "$args"
# }