Prolonging terminal sessions

From Alliance Doc
Revision as of 13:38, 21 March 2023 by Stubbsda (talk | contribs) (Created page with " =SSH configuration= =Screen= =TMUX= [https://fr.wikipedia.org/wiki/Tmux tmux] is a terminal multiplexer that allows multiple virtual sessions in a single terminal session. You can also disconnect from an SSH server without interrupting its process(es). ==Cheat sheet== For a complete reference, see [http://hyperpolyglot.org/multiplexers this page]. {| class="wikitable" |- ! Command !! Description |- | <tt>tmux</tt> || Start a server |- | <tt>Ctrl+B D</tt> || Discon...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SSH configuration

Screen

TMUX

tmux is a terminal multiplexer that allows multiple virtual sessions in a single terminal session. You can also disconnect from an SSH server without interrupting its process(es).

Cheat sheet

For a complete reference, see this page.

Command Description
tmux Start a server
Ctrl+B D Disconnect from server
tmux a Reconnect to server
Ctrl+B C Create a new window
Ctrl+B N Go to next window
Ctrl+B [ Enable "copy" mode, allowing to scroll with the mouse and Page-Up Page-Down
Esc Disable "copy" mode

Launch tmux inside a job submitted through tmux

If you submit a job with tmux and try to start tmux within the same job, you will get the lost server error message. This happens because the $TMUX environment variable pointing to the tmux server is propagated to the job. The value of the variable is not valid and you can reset it with:

Question.png
[name@server ~]$ unset TMUX

However, nested use of tmux is not recommended. To send commands to a nested tmux, one has to hit Ctrl+B twice; for example, to create a new window, one has to use Ctrl+B Ctrl+B C. Consider using screen inside your job (if you are using tmux on a login node).