Tmux: Terminal Multiplexor

Tmux is a terminal "multiplexer'.


It lets you switch easily between several terminals within A single terminal "session", detach them (they keep running in the background as a session) and reattach them from other terminal(s).


Why Tmux?


  • Protect running programs on a remote server from connection drops by running them inside tmux.
  • Allow programs running on a remote server to be accessed from multiple different terminals and/or computers.
  • Work with multiple programs and shells together in one terminal, a bit like a window manager.

Key Features


Sessions


Multiple windows are grouped together into sessions.


Windows


Multiple panes are grouped together into windows.


Panes


A pane contains a terminal.


Server and Client(s)


Tmux keeps all its state in a single main process, called the Tmux server. This runs in the background and manages all the programs running inside Tmux and keeps track of their output. The Tmux server is started automatically when the user runs a tmux command and by default exits when there are no running programs.


Users attach to the tmux server by starting a client. This takes over the terminal where it is run and talks to the server using a socket file in /tmp. Each client runs in one terminal, which may be an X(7) terminal such as xterm(1), the system console, or a terminal inside another program (such as tmux itself). Each client is identified by the name of the outside terminal where it is started, for example /dev/ttypf.


Integration with My Workflow


When I first started using tmux, I felt as if I really was not getting much benefit, but before long I started to realize the huge benefits it gave me.


Tmux augments(big word eh!?) my workflow:


  • having multiple projects/tasks/one offs left in the state I left them.
  • Seemless navigation between Neovim Windows and Tmux Panes
  • Working on/from multiple computers, I can pick up where I left off in terminals.

Some of my custom configuration:


  • mapped to [CTRL] + [SPACE], instead of default [CTRL] + [b]
  • I moved the info bar from default bottom to top.
  • Changed info bar color from default green to obnoxious pink to make it VERY obvious I am in a tmux session.
  • Added plugins "Resurect" and "Continuum" to auto save my session in the event of a system reboot.

Getting Started


Install via your package manager, configure in ~/.config/tmux/, and you're ready to go. The defaults are okay, but customization makes fit your ways of doing things and looky feely.


← back to posts