From d471ccc068d83670b5b21be27eb2d33cc9f4f417 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Wed, 10 Nov 2021 19:37:03 +0100 Subject: [PATCH] updated _username() in when the ssh client doesn't support %r in ProxyCommand in such a case, we use -o IdentityFile='%%username%%/%r' and parse the output of ssh -v --- .tmux.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 5a6b808..62447e5 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -574,7 +574,8 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # # shellcheck disable=SC2086 # username=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk '/^user / { print $2; exit }') # # shellcheck disable=SC2086 -# [ -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 }') +# [ -z "$username" ] && username=$(ssh $ssh_or_mosh_args -T -o ControlPath=none -o ProxyCommand="sh -c 'echo %%username%% %r >&2'" 2>&1 | awk '/^%username% / { print $2; exit }') +# [ -z "$username" ] && username=$(ssh $ssh_or_mosh_args -v -T -o ControlPath=none -o ProxyCommand=false -o IdentityFile='%%username%%/%r' 2>&1 | awk '/%username%/ { print substr($4,12); exit }') # else # if ! _is_enabled "$ssh_only"; then # username=${pane_info#*:}