tmux

tmux is a so-called terminal multiplexer that allows you to run multiple terminal sessions from inside a single terminal or SSH-session. The EV3 brick has a tmux session running in the background, so that if the SSH-connection fails the program you are running continues to be executed, instead of terminating it with the SSH-session.

Useful Commands

CommandFunction

tmux

Starts a new unnamed tmux session

tmux a

Attatch to last tmux session

tmux a [session name]

Attach to tmux session with the name [session name]

tmux ls

Lists all tmux sessions that are currently open

Useful Hotkeys

The hotkeys (obviously) only work, when you are inside a running tmux session.

HotkeyFunction

Ctrl + b followed by hitting d

Detach the tmux session

Ctrl + b followed by hitting s

Lists all open tmux sessions

Ctrl + b followed by hitting c

Create a new tab

Ctrl + b followed by hitting n

Switch to next tab

Ctrl + b followed by hitting p

Switch to previous

Ctrl + b followed by hitting [

Allows you to enter scrolling mode in tmux. To exit scrolling mode press Esc

Advanced stuff

The EV3 brick has a hidden tmux session running that you are not supposed to attach to. Attaching to this secret session will not work with the regular commands, since you should only attach to that session via the deploy.py. If you feel confident enough with tmux about not breaking said secret session, you can attach to it by replacing the regular tmux in the commands with the following:

$ tmux -S /tmp/tmux/shared attach -t robolab-startup

For further reading you can check out the following links: