tmux

brew install tmux

Tmux is a terminal multiplexer; it allows you to create several “pseudo terminals” from a single terminal.

#Managing

#Sessions

Action Key Commands Shell
Create :new -s db tmux new -s db
Create or Attache :new -A -s db tmux new -A -s db
Close :kill-session tmux kill-session -t name
Close all but current :kill-session -a tmux kill-session -a
Attach :attach -t vpn tmux attach -t vpn
Deattach lead, d
List lead, s :ls tmux ls
List also windows lead, w
Rename lead, $ tmux rename-session -t smap smtp
Navigate Next lead, (
Navigate Prev lead, )

#Windows

Action Key
Create Window lead, c
Close Window lead, &
Switch to N-Window lead, 0-9
Rename Window lead, ,
List Window lead, w
Toggle last Active Window lead, l
Next Window lead, n
Prev Window lead, p
Find Window lead, f

#Panes

Action Key Commnds
Close lead, x
Switch Panes lead, ←, →, ↑, ↓
Split Vertically lead, " :split-window -h
Split Horizontally lead, % :split-window -v
Resize lead, b :resize-pane -L 10
Show Panes Nnmbers lead, q
Switch to N-Pane lead, q ,0-9
Toogle fullscreen lead, z
Toogle layouts lead, space
Convert to Window lead, !
Move pane Left lead, {
Move pane Right lead, }

#Config ~/tmux.conf

#Lead Key

set -g prefix C-z
unbind C-z
bind C-z send-prefix

#Other

# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
setw -g mouse on

# Commands
bind R source-file ~/.tmux.conf \; display "Reloaded!" # Reload

#Read more