tmux-resurrect — Session Persistence
Saves and restores the complete tmux environment: sessions, windows, panes, layouts, running commands, and pane contents.
Status on This Server
Installed and active. Configured in ~/.tmux.conf.
Key Bindings
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b Ctrl+s | Ctrl+Space Ctrl+s | Save current session state |
Ctrl+b Ctrl+r | Ctrl+Space Ctrl+r | Restore last saved state |
Configuration
~/.tmux.conf
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-dir "$HOME/.local/share/tmux/resurrect"
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes 'yazi opencode ssh btop visidata python3'
| Option | Value | Purpose |
|---|---|---|
@resurrect-dir | ~/.local/share/tmux/resurrect | Where backup files are stored |
@resurrect-capture-pane-contents | on | Also saves visible pane text |
@resurrect-processes | yazi opencode ssh btop visidata python3 | Which programs to restore |
Backup Location
Files are saved to ~/.local/share/tmux/resurrect/ with the naming pattern:
tmux_resurrect_<timestamp>.txt
The last symlink in that directory always points to the most recent backup.
Restore Workflow
After a reboot or crash:
- Open any tmux session
- Press
Ctrl+Space Ctrl+r - All sessions, windows, and panes are restored (including configured programs)
Post-Save Hook
This server has a custom hook that copies every save to a dated directory under common-config for git tracking:
~/github/common-config/tmux/gc-sg-m16/continuum/<date>/
Backups older than 60 days are automatically cleaned up.