Click to go back

Tmux - The terminal multiplexer

Tmux is a program that lets you run terminal commands independently without having a client program (your terminal window) be attached to it. If you have a terminal window with a bunch of programs running on it (not necessarily running on a remote server) then you have to keep the window open to make it run. The moment you close the terminal or connection gets cut the programs also stop running.

Tmux helps you avoid this situation by letting you run these programs independently within a 'session' and 'detach' from said session. The following commands would come in handy

Command Description
tmux new-session -s [session-name] Create a new session
Ctrl+b d Detach from a session
tmux a -t [session-name] Attach to an existing session. The -t stands for target
Ctrl+b c Create a new window within a session
Ctrl+b , Rename a window within a session
Ctrl+b w Cycle between windows wthin a session
tmux kill-server Kill all sessions

You can also create panes within a single window but it does not appear to be that useful (to me atleast) because the content is always cramped in. In theory you can resize the panes but that would mean some other pane is getting squished in