From 1f5a0648206a248f75e679f6c405550bfb41550a Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sun, 5 Mar 2023 17:26:21 +0100 Subject: [PATCH] updated _username() in when the ssh client doesn't support %r in ProxyCommand (2) disabled SC2086 violation SC2086 (info): Double quote to prevent globbing and word splitting --- .tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.tmux.conf b/.tmux.conf index 12a5841..ee021f5 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -593,6 +593,7 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration' # username=$(ssh -G $ssh_or_mosh_args 2>/dev/null | awk '/^user / { print $2; exit }') # # shellcheck disable=SC2086 # [ -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 }') +# # shellcheck disable=SC2086 # [ -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_true "$ssh_only"; then