fixed _tty_info() to properly discard daemons and their children, fixes #320

This commit is contained in:
Gregory Pakosz 2020-02-29 20:15:54 +01:00
parent f4fc2730cf
commit a83ba39f09
1 changed files with 11 additions and 3 deletions

View File

@ -480,9 +480,13 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# user[$2] = $1; parent[$2] = $3; child[$3] = $2 # user[$2] = $1; parent[$2] = $3; child[$3] = $2
# } # }
# END { # 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) # file = "/proc/" i "/cmdline"; getline command < file; close(file)
# gsub(/\0/, " ", command) # gsub(/\0/, " ", command)
@ -500,7 +504,11 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# END { # END {
# for (i in parent) # 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] # print i, user[i], command[i]
# exit # exit