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.
tmux new -s session_name
Ctrl+b d
(Hold control tap b, release control, tap d)
Don't worry! This won't kill the session!
tmux attach -t session_name
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
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
Ctrl+b & or tmux kill-window -t session_name:window_number orexit (quitting the shell window closes the tmux window or pane)Please see https://github.com/tmux/tmux/wiki for more information and other options for tmux!