1
0
Fork 0
mirror of synced 2024-05-26 20:11:09 -04:00

fixed the _tty_info() and _ssh_or_mosh_args() helpers logic

- filtered ssh master connections in _tty_info()
- filtered processes reparented to pid 1
This commit is contained in:
Gregory Pakosz 2019-04-28 18:51:22 +02:00
parent e1452f1242
commit 9fbde7b9b1

View file

@ -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