From 9fbde7b9b1e9b483048cce0140d7b8d2daa0d10f Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sun, 28 Apr 2019 18:51:22 +0200 Subject: [PATCH] fixed the _tty_info() and _ssh_or_mosh_args() helpers logic - filtered ssh master connections in _tty_info() - filtered processes reparented to pid 1 --- .tmux.conf | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 96844d5..cb9db94 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -459,11 +459,13 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # # if [ x"$cygwin" = x"true" ]; then # ps -af | tail -n +2 | awk -v tty="$tty" ' -# $4 == tty { user[$2] = $1; child[$3] = $2 } +# ((/ssh/ && !/-W/) || !/ssh/) && $4 == tty { +# user[$2] = $1; parent[$2] = $3; child[$3] = $2 +# } # END { # for (i in user) # { -# if (!(i in child)) +# if (!(i in child) && parent[i] != 1) # { # file = "/proc/" i "/cmdline"; getline command < file; close(file) # gsub(/\0/, " ", command) @@ -475,11 +477,13 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # ' # else # ps -t "$tty" -o user= -o pid= -o ppid= -o command= | awk ' -# { user[$2] = $1; child[$3] = $2; for (i = 4 ; i <= NF; ++i) command[$2] = i > 4 ? command[$2] FS $i : $i } +# (/ssh/ && !/-W/) || !/ssh/ { +# user[$2] = $1; parent[$2] = $3; child[$3] = $2; for (i = 4 ; i <= NF; ++i) command[$2] = i > 4 ? command[$2] FS $i : $i +# } # END { -# for (i in user) +# for (i in parent) # { -# if (!(i in child)) +# if (!(i in child) && parent[i] != 1) # { # print i, user[i], command[i] # exit