GNU Screen zombie / defzombie for tmux

Sun 11 February 2018
By mute

If you set remain-on-exit in tmux, and are too lazy to press Prefix x y <CR> or just prefer the way GNU Screen's zombie command would ask, "Kill/Respawn" then you have found the right place.

I know this doesn't work in 2.3 that is in Debian stretch, so unfortunately you'll need a later version. I'm not sure the earliest, but I just compiled tmux 2.8 and found what I needed in it's documentation.

set-hook -g pane-died 'command-prompt -1 -p "(k)ill/(r)espawn: " "if -Ft = \"#{==:%1,k}\" kill-pane; if -Ft = \"#{==:%1,r}\" respawn-pane"'

So they're putting more logic into the tmux language, in a sort of weird way, using format specifiers. Hey, they're already there, and most sane people just want to display things in their status. I wonder what else I can do now ...