Skip to content

Commit

Permalink
fixed the _tty_info() and _ssh_or_mosh_args() helpers logic
Browse files Browse the repository at this point in the history
- filtered ssh master connections in _tty_info()
- filtered processes reparented to pid 1
  • Loading branch information
gpakosz committed May 4, 2019
1 parent e1452f1 commit 9fbde7b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 9fbde7b

Please sign in to comment.