Introduction
tmux is a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate terminal sessions inside a single terminal window or remote terminal session.
In simple terms, it allows you to execute long-lived processed that should continue to run after you disconnect from the SSH session.
Installation
sudo pkg install tmux
Usage
Simply run
tmux
to start a new session, or
tmux a
to attach to an existing session.
You can create a new window by pressing C-b c (so press Ctrl-b and then just c). Switching to the next window can be done with C-b n and switching to the previous is achieved with C-b p. For the many other options, see the References section below.
References
For more information about keybindings and other issues, check the man page:
man tmux