About

tmuxp helps you manage tmux workspaces.

Built on a object relational mapper for tmux. tmux users can reload common workspaces from YAML, JSON and dict configurations like tmuxinator and teamocil.

tmuxp is used by developers for tmux automation at great companies like Bugsnag, Pragmatic Coders and many others.

To jump right in, see Quickstart and Examples.

Interested in some kung-fu or joining the effort? API Reference and Developing and Testing.

BSD-licensed. Code on github.

Differences from tmuxinator / teamocil

Note

If you use teamocil / tmuxinator and can clarify or add differences, please free to edit this page on github.

Similarities

Load sessions Loads tmux sessions from config

YAML Supports YAML format

Inlining / shorthand configuration All three support short-hand and simplified markup for panes that have one command.

Maturity and stability As of 2016, all three are considered stable, well tested and adopted.

Missing

Version support tmuxp only supports tmux >= 1.8. Teamocil and tmuxinator may have support for earlier versions.

Differences

Programming Language python. teamocil and tmuxinator uses ruby.

Workspace building process teamocil and tmuxinator process configs directly shell commands. tmuxp processes configuration via ORM layer.

Additional Features

CLI tmuxp’s CLI can attach and kill sessions with tab-completion support. See Command Line Interface.

Import config import configs from Teamocil / Tmuxinator [1]. See Import.

Session freezing Supports session freezing into YAML and JSON format [1]. See Freeze sessions.

JSON config JSON config support. See Examples.

ORM-based API - Utilitizes tmux >= 1.8’s unique ID’s for panes, windows and sessions to create an object relational view of the tmux Server and its’ Session, Window, Pane. See About.

Conversion $ tmuxp convert <filename> can convert files to and from JSON and YAML.

[1](1, 2) While freezing and importing sessions is a great way to save time, tweaking will probably be required - There is no substitute to a config made with love.

Minor tweaks

  • Unit tests against live tmux version to test statefulness of tmux sessions, windows and panes. See Travis CI.
  • Load + switch to new session from inside tmux.
  • Resume session if config loaded.
  • Pre-commands virtualenv / rvm / any other commands.
  • Load config from anywhere $ tmuxp load /full/file/path.json.
  • Load config .tmuxp.yaml or .tmuxp.json from current working directory with $ tmuxp load ..
  • $ tmuxp -2, $ tmuxp -8 for forcing term colors a la tmux(1).
  • $ tmuxp -L<socket-name>, $ tmuxp -S<socket-path> for sockets and $ tmuxp -f<config-file> for config file.

More details


Load tmux sessions via json and YAML, tmuxinator and teamocil style.

session_name: 4-pane-split
windows:
- window_name: dev window
  layout: tiled
  shell_command_before:
    - cd ~/                    # run as a first command in all panes
  panes:
    - shell_command:           # pane no. 1
        - cd /var/log          # run multiple commands in this pane
        - ls -al | grep \.log
    - echo second pane         # pane no. 2
    - echo third pane          # pane no. 3
    - echo forth pane          # pane no. 4

Save as mysession.yaml. And load:

$ tmuxp load ./mysession.yaml

Sessions in ~/.tmuxp/ can use names:

$ tmuxp load mysession

Projects with .tmuxp.yaml or .tmuxp.json load via directory:

$ tmuxp load path/to/my/project/

Load multiple at once (in bg, offer to attach last):

$ tmuxp load mysession ./another/project/

simple, very elaborate config examples

Store configs in (~/.tmuxp) or include in your project as ~/.tmuxp.{yaml,json}. See author’s tmuxp configs and the the projects’ tmuxp.yaml.

bootstrap project dependencies before loading tmux. See the bootstrap_env.py and before_script example

You can also load sessions in the background by passing -d flag

https://raw.github.com/tony/tmuxp/master/doc/_static/tmuxp-demo.gif

Freeze a tmux session

snapshot your tmux layout, pane paths, and window/session names.

$ tmuxp freeze SESSION_NAME

See more about freezing tmux sessions.

Docs / Reading material

See the Quickstart.

Documentation homepage (also in 中文)

Want to learn more about tmux itself? Read The Tao of Tmux online.

Donations

Your donations fund development of new features, testing and support. Your money will go directly to maintenance and development of the project. If you are an individual, feel free to give whatever feels right for the value you get out of the project.

See donation options at https://git-pull.com/support.html.

Project details

tmux support 1.8, 1.9a, 2.0, 2.1, 2.2, 2.3
python support 2.6, 2.7, >= 3.3
config support yaml, json, python dict
Source https://github.com/tony/tmuxp
Docs http://tmuxp.rtfd.org
API http://tmuxp.readthedocs.io/en/latest/api.html
Changelog http://tmuxp.readthedocs.io/en/latest/history.html
Issues https://github.com/tony/tmuxp/issues
Travis http://travis-ci.org/tony/tmuxp
Test Coverage https://coveralls.io/r/tony/tmuxp
pypi https://pypi.python.org/pypi/tmuxp
Open Hub https://www.openhub.net/p/tmuxp
License BSD.
git repo
$ git clone https://github.com/tony/tmuxp.git
install stable
$ sudo pip install tmuxp
install dev
$ git clone https://github.com/tony/tmuxp.git tmuxp
$ cd ./tmuxp
$ virtualenv .venv
$ source .venv/bin/activate
$ pip install -e .

See the developing and testing page in the docs for more.

tests
$ make test