tmux is a terminal multiplexer which allows you to:
Regardless, you should always save your work. The CSU servers are periodically rebooted for maintenance, so unsaved work can still be lost, even when using tmux.
NOTE: tmux and gcc are not both available on spirit
or grail
, so we encourage you to login to another server such as arthur
to make use of these tools. However, be aware that these servers are not publicly accessible. You will first have to login to spirit
or grail
before you can login to arthur
.
tmux
to create and attach to a new session or tmux attach
to attach to an existing onenano
)Ctrl+b
, then c
to create a new tmux window. You can type new commands in this window.Ctrl+b
, then p
or n
to switch to the previous or next windowCtrl+b
, then d
to detach from the tmux sessionTo create multiple panes:
Ctrl+b
, then %
or "
to create a new horizontal or vertical paneCtrl+b
, then o
to cycle focus between panestmux |
Creates a new tmux session and attaches to it |
tmux attach |
Attaches to the newest tmux session, assuming that one exists |
tmux detach |
Detaches from the current session |
tmux list-sessions |
Shows any existing sessions which can be attached to |
Named sessions can also be created with tmux new -s homework1
, then later attached to by name with tmux attach -t homework1
.
The following shortcut keys are available in tmux, meaning you must already be in a tmux session to use them. To activate them, you must first press the tmux "Prefix" key (Ctrl+b
by default), followed by a key from the following table.
For example, to create a new window in the current session, you may press Ctrl+b
, release both keys, then tap c
. More key bindings can be found in the manual by typing man tmux
.
c |
Create a new tmux window |
n / p |
Switch to the next/previous window |
l |
Switch to the previously-focused window |
" |
Create a new pane (vertically) |
% |
Create a new pane (horizontally) |
Up /Down /Left /Right |
Focus another pane in the given direction |
o |
Cycle focus among all panes |
l |
Switch to the previously-focused pane |
w /s |
Interactively switch between windows/sessions. Use the arrow keys to select another window/session, then press enter |
d |
Detach from the current session, leaving it running in the background |