tmux

tmux is a terminal multiplexer. It lets you switch easily between several programs in once terminal, detach them, and reattach them to a different terminal.

In other words, you can run code in the background AND run/manage multiple terminal-based tasks simultaneously.

Start a new 'tmux' session

tmux new -s session_name

Detach from a session

Ctrl+b d

(Hold control tap b, release control, tap d)

Don't worry! This won't kill the session!

Reattach to a session

tmux attach -t session_name

Multiple tmux windows per session

You can also run scripts in multiple windows for a session.

Ctrl+b c Creates a new window

Ctrl+b 0 Goes to [0] first window

Ctrl+b 1 Goes to [1] second window

Ctrl+b , Renames the current window

List existing tmux sessions

tmux ls

Scroll up and down in tmux Ctrl+b PgUp page up Ctrl+b PgDn page down q to exit scrolling pages and get back to bottom line

End tmux session

Please see https://github.com/tmux/tmux/wiki for more information and other options for tmux!