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

made _ssh_or_mosh_args() consume output of _tty_info() directly

This commit is contained in:
Gregory Pakosz 2019-09-22 15:48:59 +02:00
parent d6ea9ad9c7
commit cdda729983

View file

@ -546,7 +546,7 @@ 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=""; print $0; exit }')
# 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
@ -559,14 +559,13 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# ssh_only=$2
#
# tty_info=$(_tty_info "$tty")
# command=$(printf '%s' "$tty_info" | cut -d' ' -f3-)
#
# ssh_or_mosh_args=$(_ssh_or_mosh_args "$command")
# ssh_or_mosh_args=$(_ssh_or_mosh_args "$tty_info")
# if [ -n "$ssh_or_mosh_args" ]; then
# # shellcheck disable=SC2086
# username=$(command ssh -G $ssh_or_mosh_args 2>/dev/null | awk 'NR > 2 { exit } ; /^user / { print $2 }')
# username=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk 'NR > 2 { exit } ; /^user / { print $2 }')
# # shellcheck disable=SC2086
# [ -z "$username" ] && username=$(command ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%username%% %r >&2'" $ssh_or_mosh_args 2>&1 | awk '/^%username% / { print $2; exit }')
# [ -z "$username" ] && username=$(ssh -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%username%% %r >&2'" $ssh_or_mosh_args 2>&1 | awk '/^%username% / { print $2; exit }')
# else
# if ! _is_enabled "$ssh_only"; then
# username=$(printf '%s' "$tty_info" | cut -d' ' -f2)
@ -581,9 +580,8 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# ssh_only=$2
#
# tty_info=$(_tty_info "$tty")
# command=$(printf '%s' "$tty_info" | cut -d' ' -f3-)
#
# ssh_or_mosh_args=$(_ssh_or_mosh_args "$command")
# ssh_or_mosh_args=$(_ssh_or_mosh_args "$tty_info")
# if [ -n "$ssh_or_mosh_args" ]; then
# # shellcheck disable=SC2086
# hostname=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk 'NR > 2 { exit } ; /^hostname / { print $2 }')