先找到
1 | tmux list-panes -a -F "#{pane_pid} #{pane_id}" | grep ^PID |
但是发现无法找到,查阅man
手册发现pane_pid PID of first process in pane
所以找到tty编号pts/159
1 | ps aux | grep 12934 | grep -v grep |
然后找对应session name
1 | tmux list-panes -a -F "#{pane_pid} #{pane_tty} sname:#{session_name} widx:#{window_index} pidx:#{pane_index}" | grep pts/159 |