Slide 1

Slide 1 text

TMUX: A Screen Redux by Stephen Coley

Slide 2

Slide 2 text

What is TMUX? “A terminal multiplexer is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session.” - Wikipedia

Slide 3

Slide 3 text

Why? Useful for dealing with multiple programs from a command line interface, and for separating programs from the shell that started them

Slide 4

Slide 4 text

Mice Are Stupid

Slide 5

Slide 5 text

Keyboards Are Awesome

Slide 6

Slide 6 text

MOBI Development Worth Noting ● Context switching - Features, Bugs, Tasks ● Development, Demo, Production Console Programs ● Terminal for Git ● IRB/PRY Console ● Tailing a Log ● Resque Workers, Solr, Mailcatcher ● Text Editor (optional, ya wuss)

Slide 7

Slide 7 text

Vocabulary Sessions - Persistent, detachable workspaces Windows - “Tabs” that occupy the entire Session window Panes - Partitions within Windows Prefix - Keystroke that precedes TMUX commands * Default is Ctrl-b. This presentation uses Ctrl-a Command Line TMUX Keystrokes

Slide 8

Slide 8 text

Sessions Create a new session: tmux new -s * Immediately attaches to the new Session Detach from current session: Ctrl-a + d or tmux detach * Does not destroy the session List sessions: tmux list-sessions * This will display the name or id of the sessions and # of windows Attach to session: tmux attach -t * If you only have one session: tmux attach Invoke session switcher: Ctrl-a + s * This lets you cycles through open sessions Command Line TMUX Keystrokes

Slide 9

Slide 9 text

Windows Create a new window: Ctrl-a + c Rename current window: Ctrl-a + , * Window names default to currently running process Switch to window: Ctrl-a + * Window numbers start with 0 by default Kill current window: Ctrl-a + & Invoke window switcher: Ctrl-a + w TMUX Keystrokes Command Line

Slide 10

Slide 10 text

Panes Split horizontally: Ctrl-a + “ == Remap ==> Ctrl-a + h Split vertically: Ctrl-a + % == Remap ==> Ctrl-a + v (ahem..Natively) Switch to another pane: Ctrl-a + o Swap pane locations: Ctrl-a + Ctrl-o Kill current pane: Ctrl-a + x Kill all except current pane: Ctrl-a + ! Command Line TMUX Keystrokes

Slide 11

Slide 11 text

...but Screen? Screen is considered a dead project ● Not actively maintained ● Heavy resource consumption ● S'ghetti code ○ Discourages bugfixes and improvements ● Config is notoriously obtuse ● No vertical splits, whaaaa? ○ There's a patch to make this work, but it has not been added to the official codebase ○ 4.1 discussed in Feb 07

Slide 12

Slide 12 text

Screen is Dead

Slide 13

Slide 13 text

...but TMUX! “The most impressive thing about tmux, in my view, is how frustrating the code audit was. In 2 hours, I found only one or two that had very minor security consequences. It was not accepted into the tree based on license alone. It is high quality code” - Theo de Raadt, founder and project lead for OpenBSD

Slide 14

Slide 14 text

TMUX’s Case vs Screen ● Client-Server Model: Windows are independent entities which may be attached simultaneously to multiple sessions and viewed from multiple clients, as well as moved freely between sessions within the same tmux server ● Consistent, well-documented command interface, with the same syntax for interactivity, key binding, and from the shell ● Multiple paste buffers ● Emacs or vi key layout. AKA Developer Heaven ● Nice status line syntax - with dynamic output ● A cleaner, modern, easily extended, BSD-licensed codebase. ● Status bar on by default ● Native vertical splits!

Slide 15

Slide 15 text

Remote Pairing Demo

Slide 16

Slide 16 text

Happy TMUXing!

Slide 17

Slide 17 text

Questions?