Some fellow Tmux users I spoke with weren't using the Sessions feature, which I think is one of the coolest features of Tmux. No faulting the Tmux developers for very complete documentation, but it can take a few read-throughs for some of us before the core architecture becomes clear:
- The Tmux Server is a collection of Sessions.
- A Session is a collection of Windows.
- A Window is a collection of Panes which visually subdivide it in the terminal.
- Windows and Panes can be moved and shared between Windows, including Windows in other Sessions.
Having used a modern web browser, you already understand principles 1-3. You can open multiple browser windows (Tmux Session), each browser window has multiple tabs (Tmux Window), and each tab has a web page which probably contains multiple visual sections (Tmux Pane).
Using these principles you can easily build up different kinds of shell environments that group tools and views together logically for different kinds of problems you might work on.
- If you are working on multiple projects (open source / personal / work / whatever) you can create a Session for each one and have all your shells, consoles, logs, etc. available to switch to with a couple keystrokes.
- Within a project you might be working on a significantly different branch. With Sessions it is easy to manage seperate installations of the same project by being able to jump back and forth between contexts.
OK, there's one other thing you really need to know before going too far. The environment for each Tmux entity you create will be determined by:
- The Server will inherit the environment of the terminal it is stared in. Once started, the Server's environment can be modified.
- A new Session will inherit the environment of the Server. Once created, the Session's environment can be modified.
- A new Window will inherit the environment of the Session.
- A new Pane will inherit the environment of the Window.
The power of the tool doesn't come for free; there can be annoyances. For example, if you have your web framework's dev server running in one session, you need to specify a different port if you want to start one in another session. A pitfall is that you can do things like creating a new window and being in an environment context you don't expect. (Show example)
##Using Tmux with Python virtualenv
This is great! I am using Tmux, and this really caught my attention.
Seems like this gist is a work-in-progress - wouldn't mind reading the ending ;)