tmux
Use this command to create 'sessions' which can be preserved, and joined by others.
Note the default .tmux.conf should include the 'tmux-resurrect' and 'tmux-continuum' plugins to enable automatic session restoration, when evoking tmux again for the first time on the environment. See .tmux.conf for other configuration details. Mouse-mode is also automatically enabled (can click for pane focus, and drag panes sizes with mouse).
tmux new -A -s <name> # start a new session, giving a name (-A detaches current then joins or creates if it doesn't exist)
tmux a # attach to previous session
tmux a -t <session_name> # attach to session by name
tmux ls # list sessions
exit # enter at any tmux session window to kill that session
Ctrl+b+: (enter cli mode, see below), then enter: new-session -s <name>
Ctrl + b + <hotkey> # see below
Crtl+b + <hotkey below>:
# General Hotkeys:
? # see all hotkey bindings
: # go to tmux 'cli', and enter manual commands (see below)
d # detach from a session/tmux (exit tmux and go back to cli, but keeps session open)
# Session hotkeys:
s # switch to another session
w # list sessions and their windows
$ # rename session
( # previous session
) # next session
# Window hotkeys:
<#> # go to specific window #
c # create a new window
, # rename window
& # close window
n # next window
p # previous window
# Pane Control hotkeys:
% # split window/pane vertically
" # split window/pane horizontally
{ # move pane left
} # move pane right
(arrow) # move pane in direction
space # toggle pane layout
kill-session -t 0 # end a specific session by id/name
kill-session -a # kill all other sessions except the current
kill-server # end all sessions (use 'tmux' to start the server again)
https://medium.com/@hammad.ai/useful-tmux-plugins-which-i-frequently-use-at-work-41a9b46f7bcb
ctrl+b + :
select-pane -t:.0 -P 'bg=black'
select-pane -t:.1 -P 'bg=black'
select-pane -t:.2 -P 'bg=black'
Restart a closed process or session:
fg (unix-specific)