My pane layout for playing single player asymmetrical tic tac toe.
We both know why you’re here. You wanna refresh your memory and look up a few commands. I wrote this cheatsheet for myself so that I could do the same. Make yourself comfortable. There’s a great book on tmux that you probably may want to check out.
The command Prefix
While we’re in a tmux
session, we need to tell tmux
that the command we’re about to send to it is destined for tmux
indeed and not for the underlying application. The <ctrl+b>
combination does just that. Since that is just a command prefix, you need to type in the actual command after that, hence why, in order to for example send a detach
command, we need to press ctrl
and b
together, release those two, and after that press the command we want. People annotate it differently, I will stick to the C->d
notation, where C
is the command prefix, and whatever follows the arrow is the command.
Commands
Basics
tmux
- start a new sessiontmux new -s <session_name>
- create a named sessionexit
orC->d
- detach from a sessiontmux ls
- to list currently active sessionsAtmux attach
to attach to a session that’s running (if there’s only one)tmux attach -t <session_name>
- attach to a named session. (if you don’t know what sessions you have, runtmux ls
)tmux kill-session -t <session_name>
- self explainatorytmux new -s <session_name> -n <window_name>
- create a session with a named first windowC->$
- rename current session. alt cmd:rename-session -t <current_name> <new_name>
Windows
C->c
- create a new window (while in session)C->,
- rename current windowC->n
,C->p
- next window, previous window, respectivelyC->[0..9]
- select a window by numberC->w
- display a selectable list of windows in the current sessionC->&
- kill window with a confirmation messageexit
- while in multiple-window session, kill window
Panes
C->%
- divide the current window (or pane) verticallyC->"
- divide the current window (or pane) horizontallyC->o
- cycle through panesC->q
- momentarily displays pane numbers in each paneC-><arrow_key>
- move around the panes in direction of<arrow_key>
C->spacebar
- cycle through pane layoutsC->X
- close pane. alt: just typeexit
Command mode
C->:
- enter command modenew-window -n <name> "<command>"
- create a new window named<name>
, with<command>
running immediately