From 20fa97e310f0e98d259182bb47c88d4e159cb6bb Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Thu, 26 Sep 2019 13:45:35 +0200 Subject: [PATCH] optimized _ssh_or_mosh_args() by deferring calls to external programs --- .tmux.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 4b9d855..e409b52 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -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" # }