Tmux

Tmux is a “terminal multiplexer”, it enables several terminals (or windows) to be accessed and controlled from a single terminal. tmux is intended to be a simple, modern, BSD-licensed alternative to programs such as GNU screen.

Official GitHub page for tmux.

Start tmux:

$ tmux

Start tmux while giving session a name.:

$ tmux new -s newsession

If no name is given, it will be assigened a number starting from 0.

List tmux sessions:

$ tmux ls

Kill tmux session:

$ tmux kill-session -t newsession
or
$ tmux kill-session -t 0

When in a tmux session, press CTRL+b to gain access to the tmux command line. From here you can customize your session:

% = Split window vertically
" = Split window horizontally
⍽ = Toggle between layouts
z = Make pane fullscreen/view all panes
x = Kill pane
c = Create new window
w = list windows
n = Next window
w = list windows
p = previous window
f = find window
, = name window
& = kill window

To configure tmux, you will need to create a file tmux.conf file located in your home dir. In this file, session settings can be set:

# Enable mouse mode
set -g mouse on

# Enable colors
set -g default-terminal "tmux-256color"

# Increase scrollback history buffer (Example will be able to remember the last 10000 lines)
set -g history-limit 10000