This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
tmux
¶
tmux
(terminal multiplexer) is a program that enables a number of terminals (or windows), each
running a separate program, to be created, accessed, and controlled from a single screen or
terminal window.
Reference(s)
Table of contents¶
Install¶
Config¶
If like me, you have some commands and personal scripts in your .zlogin
or .login
(e.g. like
startx
), you should modify it like so:
# vi ~/.zlogin
> pgrep 'tmux|startx' || (
> some-command &
> some-personal-script &
> ...
> startx &
> )
Use¶
-
Start
tmux
: -
Detach from
tmux
(without killing session): -
Restore
tmux
session: -
Detach an already attached session (great if you are moving devices with different screen resolutions)
-
Display session:
-
Rename session:
-
Switch session:
-
List sessions:
-
Start a shared session:
-
Help screen (Q to quit):
-
Scroll in window:
-
Enter scroll mode:
(then up up/down arrow keys and/or pageup/pagedown) -
Exit scroll mode:
-
Reload configuration file
Window management¶
-
Create window:
-
Destroy window:
-
Switch between windows:
-
Split windows horizontally:
-
Split windows vertically:
-
Swap windows
tmuxp
¶
tmuxp
is a tmux
session manager: see https://github.com/tmux-python/tmuxp.
TODO
Troubleshooting¶
- If you get the following error message after running
$ tmux ls
:error connecting to /tmp/tmux-1000/default (No such file or directory)
, then this is probably because notmux
session is running (in this case$ pgrep tmux
should return an error, i.e. a number superior to 0).
If this cheat sheet has been useful to you, then please consider leaving a star here.