tmux

How to kill a tmux pane along with the process running on it?


Let's say you run a command like grunt serve on a tmux pane, and you kill the pane on which the command is running. I found that the process is not killed:

ps aux | grep grunt

still shows that grunt is running even though the pane is gone. How do you kill a tmux pane along with the process(es)?


Solution

  • You may find the tmux-safekill plugin useful.

    I wanted it to kill Ruby processes, so I had to fork the repo to add that functionality in, so I'm sure you could do the same for grunt processes if you don't get all the functionality you need from the repo directly.