Tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.
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 local 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
Tmux augments my workflow:
- Neovim integration: Seemless navigation between Neovim Windows and Tmux Panes
Getting Started
Install via your package manager, configure in ~/.config/tmux/, and you're ready to go. The defaults are excellent, but customization makes it truly yours.
