explaingit

tmux-plugins/tmux-resurrect

12,747ShellAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A tmux plugin that saves your entire terminal session layout and restores it after a restart. One keyboard shortcut saves all open windows, panes, and working directories, another brings them all back.

Mindmap

mindmap
  root((repo))
    What it does
      Save tmux session
      Restore after restart
      Recover pane layouts
    Restored items
      Windows and panes
      Working directories
      Running programs
    Setup
      Plugin Manager install
      Manual clone install
      No config required
    Platform support
      Linux
      macOS
      Cygwin
    Related tools
      tmux-continuum
      Vim session restore
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Save your tmux workspace before shutting down and restore every window, pane, and working directory exactly as you left it.

USE CASE 2

Automatically restore vim or neovim editor sessions alongside your terminal layout after a reboot.

USE CASE 3

Use alongside tmux-continuum to save your environment periodically without remembering to do it manually.

USE CASE 4

Add custom programs to the restore list so your full development environment comes back on startup.

Tech stack

ShellBashtmux

Getting it running

Difficulty · easy Time to first run · 5min
MIT license, use freely for any purpose, including commercial projects, as long as you keep the original copyright notice.

In plain English

tmux is a terminal multiplexer: a program that lets you run multiple terminal sessions inside a single window, split your screen into panes, and keep sessions running even when you disconnect. tmux-resurrect is a plugin for tmux that solves one long-standing problem: when you restart your computer or close tmux, all your open sessions, window layouts, and working directories disappear. With tmux-resurrect installed, you can save your entire tmux environment with a keyboard shortcut (prefix + Ctrl-s) and restore it later (prefix + Ctrl-r). When you come back after a restart, your sessions, windows, pane layouts, and the working directory for each pane are all recovered exactly as you left them. No configuration is required for this basic functionality. By default, the plugin also restores a short list of common programs that may have been running in your panes, such as vim, emacs, htop, and mutt. Additional programs can be added to the restore list in configuration. Optionally, the plugin can restore vim and neovim editor sessions and the text content of pane buffers, though these features are off by default. The plugin can be installed through the Tmux Plugin Manager or by cloning the repository manually. It works on Linux, macOS, and Cygwin, and requires tmux 1.9 or later plus bash. A companion plugin called tmux-continuum handles automatic periodic saving so you do not have to remember to save manually. The project is MIT licensed.

Copy-paste prompts

Prompt 1
Install tmux-resurrect with the Tmux Plugin Manager and configure it to also restore my vim sessions on startup.
Prompt 2
Write a shell script that triggers tmux-resurrect's save shortcut on a schedule so my session is backed up hourly.
Prompt 3
Add htop and a custom CLI tool to the tmux-resurrect programs restore list, show me the exact config lines.
Prompt 4
Explain the difference between tmux-resurrect and tmux-continuum and how to configure both together for automatic save and restore.
Prompt 5
Help me debug why tmux-resurrect is not restoring my pane working directories after I update to a newer tmux version.
Open on GitHub → Explain another repo

← tmux-plugins on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.