I need a way to immediately restart the main process in a tmux pane after the pane's the process has terminated.
I use byobu-tmux to run various components of a client-server (grails) application that I'm developing. I've written a shell script which opens panes and starts all of the components:
byobu-tmux split-window -h "sleep 10; <client-1-start-script>" byobu-tmux split-window -t 1 -v -p 66 "sleep 10; <client-2-start-script>" byobu-tmux split-window -t 2 -v -p 50 "sleep 10; <client-3-start-script>" byobu-tmux split-window -t 0 -v "<server-start-script>"
This script works but, as you might expect from tmux, whenever you kill one of the pieces it closes that pane. I have also tried to add in a bash wrapper:
byobu-tmux split-window <opts> "<script>; byobu-tmux respawn-pane"
and use an explicit bash environment:
byobu-tmux split-window <opts> "bash -i -c \"<script>\""
This question demonstrates how to keep the pane open, but is there any way to get the command that was executed on creation of the pane to rerun instead of closing the pane?