← Back to Upcase

Save and reopen tmux session

Hi, everyone -

I am new to tux and finally got the panes and splits exactly as I like them for my current Rails project. Is there a way to save this setup so that it starts this way every time start tmux?

Thanks, Hunt

Two of the most popular ways to do this (that I know of) are Tmuxinator and Tmux Resurrect.

With Tmuxinator, you set up yaml files which define predetermined layouts. You can then launch these layouts by running a single command.

Tmux Resurrect (which I prefer) allows you to save your tmux layout, and then “resurrect it” later by pressing a key combo. Tmux Resurrect also supports vim sessions and a few other processes that you might want to respawn after restarting your machine.

The author of Tmux Resurrect has recently released a new plugin called Tmux Continuum which restarts everything automatically. Sounds good, though I’ve not tried it myself yet.

Hope that helps!

1 Like

@joshukraine did a great job summarizing the various options for this, so I will just second everything he said with regard to the tools and workflows for automating tmux session layouts.

The one thing I will add is that while I have used tools like tmuxinator in the past, I no longer use them. I find that my desired layout changes somewhat regularly depending on the task (TDDing out a new feature, tracking down a bug, working with production data, etc) and I value that flexibility.

Beyond that, I’ve optimized and streamlined my workflow around creating and arranging panes such that it is very easy to change the layout on the fly. Check out the Navigation and Vim Integration videos in the tmux trail for tips on this.

@joshukraine – Tmux Resurrect does exactly what I wanted. Thanks for the recommendation.

@christoomey – you rock!

But if I want multiple sessions to save ?

resurrect only saves one.