ptsが属するtmuxウィンドウを探す

ptsが属するtmuxウィンドウを探す

何らかの理由で私はtmuxウィンドウ(およびブラウザタブ)のコレクションを持っているようです。しかし、それは別の話です。ウィンドウの1つの背景にプロセスがあり、そのウィンドウを探したいです。でプロセスに関連付けられているptsデバイスを表示できますps。どのptsデバイスがどのウィンドウに関連付けられているかを見つける方法はありますか?

ベストアンサー1

はい、list-panesコマンドで可能です。

tmux list-panes -a -F '#D #{pane_tty}'
%0 /dev/pts/9
%1 /dev/pts/10

これを使用してより多くのコンテンツを一覧表示できます。

tmux list-panes -a -F '#D #T #{pane_tty} #{pane_current_command} #{pane_current_path}'
tmux list-windows -a -F '#{window_id} #W #{window_layout}' | while read w i; do echo $w $i; tmux list-panes -t "$w" -F "  #D #{pane_tty} #T #{pane_current_command}"; done

tmuxマニュアルページのフォーマットセクションを確認してください。

おすすめ記事