This post discusses tmux, a terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be run simultaneously in a single window. Other uses include executing remote commands in a session on a server through an SSH connection, disconnecting, and later returning to the session to see the command output.
First thing is first- add this to your ~/.tmux.conf
setw -g mode-keys vi set -g history-limit 10000
# bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i' # linux bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'pbcopy' # mac
Cheat Sheet
A printable version of this cheat sheet is available here.
Session Control
Session Control (from the command line)
Description
tmux
Start a new session
tmux new -s <session-name>
Start a new session with the name chosen
tmux ls
List all sessions
tmux attach -t <target-session>
Re-attach a detached session
tmux attach -d -t <target-session>
Re-attach a detached session (and detach it from elsewhere)