TMUX

Terminal Multiplexer. Start multiple “terminal sessions” in a single window.

brew install tmux

The advantage is that you can connect, disconnect from different sessions, whilst staying in a single terminal.

Useful when you are working on “just a laptop” screen.

When you want to keep a programme, task, or long-running command, you can detach from one TMUX session, and attach to another:

$ tmux
[detached (from session 0)]
$ tmux ls
0: 1 windows (created Sun Jul 14 20:56:06 2019)
$
$ tmux attach-session -t 0
[detached (from session 0)]
  • tmux to start a new session (or specify a name):

    tmux new -s my_session)

  • CTRL b d to detach.

  • tmux attach-session -t «session number»