Max SchmittMS
20th October 2020

How to close all tmux panes at once

I like to write little tmux scripts that help me boot up the dev-servers of whatever project I'm about to work on.

Just as I like to be able to start working on a project with a single command, I like to be able to stop working on it quickly, so I can switch over to something else.

I've bound Prefix + X to close all panes in a tmux session at once, basically killing the entire tmux session.

To do the same, just add the following code to your .tmux.conf:

bind X confirm-before kill-session

You might need to kill any remaining processes even once your tmux session was killed, which is why I usually run killall node right after. :)

Image of my head

About the author

Hi, I’m Max! I'm a fullstack JavaScript developer living in Berlin.

When I’m not working on one of my personal projects, writing blog posts or making YouTube videos, I help my clients bring their ideas to life as a freelance web developer.

If you need help on a project, please reach out and let's work together.

To stay updated with new blog posts, follow me on Twitter or subscribe to my RSS feed.