2023-12-04 10:02:23 +00:00
---
obj: application
repo: https://github.com/tmux/tmux
arch-wiki: https://wiki.archlinux.org/title/tmux
wiki: https://en.wikipedia.org/wiki/Tmux
2024-12-16 07:59:39 +00:00
rev: 2024-12-16
2023-12-04 10:02:23 +00:00
---
2024-03-08 21:53:45 +00:00
2023-12-04 10:02:23 +00:00
# tmux
2024-12-16 07:59:39 +00:00
tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.
2023-12-04 10:02:23 +00:00
# Usage
**New tmux session:**
```shell
2024-12-16 07:59:39 +00:00
tmux
2023-12-04 10:02:23 +00:00
tmux new -s name
2024-12-16 07:59:39 +00:00
tmux new -s mysession -n mywindow
2023-12-04 10:02:23 +00:00
```
**List existing sessions:**
```shell
tmux ls
```
**Attach to a named session:**
```shell
tmux attach -t name
2024-12-16 07:59:39 +00:00
tmux a -t name
2023-12-04 10:02:23 +00:00
```
**Kill a session:**
```shell
tmux kill-session -t name
```
# Keybinds
2024-12-16 07:59:39 +00:00
- Show the time: `Ctrl-b + t`
## Sessions
- Rename current session: `Ctrl-b + $`
2023-12-04 10:02:23 +00:00
- Detach from a running session: `Ctrl-b + d`
2024-12-16 07:59:39 +00:00
- Sessions and windows overview: `Ctrl-b + w`
- Move to previous session: `Ctrl-b + (`
- Move to next session: `Ctrl-b + )`
- Switch sessions: `Ctrl-b + s`
## Windows
- Create a new window: `Ctrl-b + c`
- Rename current window: `Ctrl-b + ,`
- Go to previous window: `Ctrl-b + p`
- Go to next window: `Ctrl-b + n`
- Go to window: `Ctrl-b + [0-9]`
## Panes
- Vertical Split: `Ctrl-b + %`
- Horizontal Split: `Ctrl-b + "`
- Select Pane: `Ctrl-b + q + [num]`
- Change Pane Size: `Ctrl-b + Ctrl + [Down/Up/Left/Right]`
- Move current pane left: `Ctrl-b + {`
- Move current pane right: `Ctrl-b + }`
- Close current pane: `Ctrl-b + x`
- Switch to the next pane: `Ctrl-b + o`
- Convert pane into a window: `Ctrl-b + !`