As always in my carrer i’ve been pushed by the needs to solve and specific problem, this time i was just about to upgrade my Fedora 29 to Fedora 30, i’m already late! Then i was to reboot and proceed and then accounted my tmux list-sessions to try to recover them later on. Then it came to me the idea that there should be a sort of “restore my session” support for tmux, and as almost always happens with FOSS, we have a solution and searching the net the way to go.
If you are new to tmux plugins, as i am, start by reviewing your tmux version. This is what i get from my F29 installation.
As i can verify from tmux main site at github, we have in F29 a very recent version. Also, before trying to install from other methods, i made a search on dnf repos:
We don’t really have a first support for tmux plugins from Fedora packages, perhaps you can start packaging some to get involved in Fedora.
Moving on into my cruise to F29 -> F30 upgrade and “restore my sessions in tmux”, the tmux plugins needed to solve the problem are:
So, i need to install them, how? We know already know we can’t from Fedora official repos, what about third party repos? After a quick search on third party common dnf/yum repos, i don’t find any, so i move forward with Tmux Plugin Manager (tpm) instructions.
My ~/.tmux.conf added lines:
Since tmux is running, i do have to reload the configuration:
Installing plugins with tpm
Add new plugin to ~/.tmux.conf with set -g @plugin ‘…’
Press prefix + I (capital i, as in Install) to fetch the plugins in a tmux session. You can see the sources are installed looking at your configured tmux plugins directory:
Final setup just needs another configuration line added:
Usage
With this configuration, there’s no need to do anything manually. Your tmux sessions will be automatically saved every 15 minutes and automatically restored when tmux is started (e.g. after a reboot). You can manually save with prefix-Ctrl-s and manually restore with prefix-Ctrl-r if desired.