From a83ba39f09534c2df8f9e94e48174d67be030976 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sat, 29 Feb 2020 20:15:54 +0100 Subject: [PATCH] fixed _tty_info() to properly discard daemons and their children, fixes #320 --- .tmux.conf | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index de35325..fa47bee 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -480,9 +480,13 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # user[$2] = $1; parent[$2] = $3; child[$3] = $2 # } # END { -# for (i in user) +# for (i in parent) # { -# if (!(i in child) && parent[i] != 1) +# j = i +# while (parent[j]) +# j = parent[j] +# +# if (!(i in child) && j != 1) # { # file = "/proc/" i "/cmdline"; getline command < file; close(file) # gsub(/\0/, " ", command) @@ -500,7 +504,11 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim # END { # for (i in parent) # { -# if (!(i in child) && parent[i] != 1) +# j = i +# while (parent[j]) +# j = parent[j] +# +# if (!(i in child) && j != 1) # { # print i, user[i], command[i] # exit