Want to see the full-length video right now for free?
Sign In with GitHub for Free AccessTmux is the "terminal multiplexer," which in the creator's own words means:
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. And do a lot more.
The primary focus of these videos is on using tmux for local development, although the content will easily apply to all contexts tmux can be used in.
Tmux is a very popular package and should be available on any system package manager. In my case, as an OS X user, this means I can install with:
$ brew install tmux
The easiest way to start a tmux session is to run the bare tmux
command
from your terminal.
Once running, most tmux interaction will occur by using tmux's key bindings.
By default all tmux key bindings will require a "prefix" key sequence before
they are active. This prefix is initially defined as
Ctrl-b
(Ctrl
and b
together).
<prefix> %
=> Split window horizontally (to the right of the current pane)<prefix> "
=> Split window vertically (below current pane)<prefix> o
=> Jump to other paneThe tmux configuration file lives at ~/.tmux.conf
. Edit it to redefine the
prefix key by adding the following lines:
# Use C-s (control and s key at the same time) as the prefix key
unbind C-b
set -g prefix C-s
After saving the file, you can reload the configuration by running:
$ tmux source-file ~/.tmux.conf
In addition to changing the prefix key, I also recommend remapping your caps lock key to act as a control key so that the tmux prefix can be pressed with your hands still on the home row. Use the following links to help configure this: