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)?
To close a pane, first ensure that you're positioned in it. Then type "exit" or Ctrl-d. Note that there is no need for Ctrl-b in this step. Once you type "exit" or Ctrl-d in the last remaining pane, tmux will close.
When tmux kill-session is run, all processes inside tmux will receive SIGHUP, so they should exit gracefully on their own. Save this answer. Show activity on this post. If your process can be killed with Ctrl+c , a tmux plugin called tmux-safekill may do the trick.
ctrl + d kills a window in linux terminal, also works in tmux.
To stop the program running you can close the pane by entering <C-B> x
and then entering y
.
Use Ctrl + b¹, > to get a menu with this and other useful commands:
This is what uses the Spotify plugin.
¹ Or the chosen tmux escape sequence.
tmux list-keys | grep display-menu #
curl cht.sh/tmux # Online cheatsheet
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With