I want to find the sessions which only have dead panes, to then kill them. How do I do this?


You can list all panes and then filter by dead panes:

tmux list-panes -a -F "#{pane_dead} #{pane_id}" | grep "^1"

And you can kill them with

tmux kill-pane -t PANE_ID

combine this into:

tmux list-panes -a -F "#{pane_dead} #{pane_id}" | \
  awk '/^1/ { print $2 }' | xargs -l tmux kill-pane -t
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.