Save and reopen tmux session

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