Where could this be used?

Hi, thanks for your question. I'm going to cross-post this from a reddit comment that asked the same thing.

tmux[1] is oriented toward commandline users on posix-like systems. libtmux is a python library to help you script and automate tmux. it abstracts the concept of the server, its sessions, their windows and panes [2] into a herarchy you can easily navigate, even with a live tmux session.

I don't know if you use cli, tmux, or a tmux session manager (tmuxinator, teamocil, tmuxp) already, so its hard to tailor this answer specifically.

command line

a good deal of programmers, sysadmins, etc. use the terminal routinely throughout their day. some even go so far as to swear off a graphical IDE all together, and use screen or tmux with a combination of an editor like vim, emacs and others.

if you primarily use windows and don't use linux/bsd/os x terminal often, if you ever do, i highly recommend giving screen[3] or tmux a shot.

tmux

the benefit to using the terminal means tmux lets you do a couple things:

- split your terminal into multiple PTY's (panes) and windows, copy and paste between them. No GUI required - "detach" the tmux sesssion, sending it (and any shells/applications running in the panes) to the background, and come back later to reattach - it is also seamless to SSH into a server and work from there, since there's no GUI involved, you can use the same workflow on OS X, Linux or BSD machines.

I write in detail about tmux here: http://tmuxp.readthedocs.io/en/latest/about_tmux.html

tmux configuration

a good amount of developers use screen or tmux on a regular basis. over time, a variety of plugins have popped up. tmuxinator[4], teamocil[5] and tmuxp[6] (my own, written in python) being ways to load pre-configured sessions from a YAML file.

scripting / automating tmux with libtmux

so here is where libtmux comes in, it can be used to control tmux via python objects, which can be very handy in situations where you want to interface with tmux at a low level expressively.

it is possible to script things via shell, but there's no way to know the state or easily traverse through the tree of Server -> Sessions -> Windows -> Panes.

tmuxp uses libtmux under the hood a way to build sessions[7]. other developers have used tmuxp[8]* for scripting tmux to the workflow of their projects.

* note: I link to `import tmuxp` because the API would formerly be in that project for the past few years. libtmux decouples the core into its own library.

[1] https://tmux.github.io/ [2] http://libtmux.readthedocs.io/api.html [3] https://www.gnu.org/software/screen/ [4] https://github.com/tmuxinator/tmuxinator [5] https://github.com/remiprev/teamocil [6] https://github.com/tony/tmuxp [7] https://github.com/tony/tmuxp/blob/master/tmuxp/workspacebui... [8] https://github.com/search?utf8=%E2%9C%93&q=%22import+tmuxp%2...