explaingit

tmux-python/tmuxp

4,497PythonAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A session manager for tmux that lets you save your terminal window layouts and startup commands to a YAML file and restore the whole setup instantly with one command.

Mindmap

mindmap
  root((tmuxp))
    What It Does
      Save tmux layouts
      Restore in one command
    Config Format
      YAML or JSON
      Sessions and windows
      Pane commands
    Key Commands
      tmuxp load
      tmuxp freeze
      tmuxp shell
    Setup
      pip install
      Homebrew
      Debian package
    Requirements
      Python 3.10 plus
      tmux 3.2 plus
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 project's terminal layout to a YAML file and restore it with one command every time you start work

USE CASE 2

Define separate workspaces for different projects, each with specific panes and auto-starting commands

USE CASE 3

Snapshot a live tmux session you already have arranged and turn it into a reusable config file

USE CASE 4

Run pre-load shell hooks to install dependencies automatically before a project session starts

Tech stack

PythontmuxYAML

Getting it running

Difficulty · easy Time to first run · 5min

Requires Python 3.10+ and tmux 3.2+ already installed on the system.

Use freely for any purpose, including commercial projects, as long as you keep the copyright notice.

In plain English

tmuxp is a session manager for tmux. Tmux is a terminal multiplexer, a program that lets you split your terminal into multiple panes and windows and keep them all running even if you disconnect. Setting up a specific layout of panes and starting the right commands in each one every time you sit down to work on a project is repetitive. tmuxp solves this by letting you describe that layout in a YAML or JSON config file and then restore the whole thing with a single command. A config file specifies a session name, the windows you want, what layout each window uses, and what commands should run in each pane. Running tmuxp load ./mysession.yaml recreates that exact setup. If you already have a tmux session arranged the way you like, tmuxp freeze can snapshot it to a config file so you can reload it later. Config files from the similar tools tmuxinator and teamocil are also supported. The tool includes a shell mode, tmuxp shell, which opens a Python console with the current tmux server, session, window, and pane available as objects you can inspect and manipulate programmatically. This is useful for debugging or scripting more complex tmux behaviors. A pre-load hook system lets you run arbitrary shell commands (such as installing dependencies) before a session is brought up. tmuxp is a command-line tool installed via pip, Homebrew, or the system package manager on Debian and Ubuntu. It requires Python 3.10 or later and tmux 3.2 or later. It is built on top of libtmux, a separate Python library for controlling tmux. The license is MIT.

Copy-paste prompts

Prompt 1
Write a tmuxp YAML config for a web dev workspace with panes for the dev server, test runner, and git log
Prompt 2
How do I use tmuxp freeze to snapshot my current tmux session layout and save it as a config file?
Prompt 3
Create a tmuxp config that opens a Python project with one pane running Flask and another running pytest in watch mode
Prompt 4
How do I add a pre-load hook in tmuxp to run npm install before my project session launches?
Open on GitHub → Explain another repo

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

Verify against the repo before relying on details.