wiki:tmux
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| wiki:tmux [August 19, 2026 at 16:36] – Ivan Janevski | wiki:tmux [August 19, 2026 at 17:25] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | # tmux | + | # Tmux |
| - | **tmux** is a [[terminal|terminal]] multiplexer. It allows you to run multiple terminals in a single terminal. In this sense, it is an alternative to `screen` command. | + | |
| - | Tmux runs a background session | + | **Tmux** is a terminal multiplexer |
| - | Here's what it looks like: | + | Think of it as a tiling window manager for the terminal. You don't need a graphical interface. You can run tmux over SSH, detach when your connection drops, and reattach later. Sessions, windows, and panes persist independently of terminal windows. |
| - | ## Concepts | + | ```bash |
| - | ### Sessions | + | $ tmux |
| - | Sessions are run in the background. You can attach to them from any terminal you like using `tmux attach`. But first, you have to create at least one session. You create a session by running `tmux` in the terminal (no arguments). Once you're in a tmux session, you can detach from it by pressing | + | $ tmux attach |
| + | $ tmux list-sessions | ||
| + | $ tmux new-session | ||
| + | ``` | ||
| - | Assuming you ran `tmux` multiple times -- meaning you created multiple sessions -- you can cycle between sessions with `Ctrl + b, (` (previous session) or `Ctrl + b, )` (next session). This means pressing Ctrl + b, releasing both, then pressing Shift + 9 or 0, for `(` and `)` respectively (on English keyboards at least). If you want to kill the session, you press `Ctrl + b, :` to enter command mode, type in " | + | The prefix key is `Ctrl+B` by default. Press it, release, then press the command (e.g., `Ctrl+B` then `d` to detach). Tmux is highly customizable via `~/ |
| - | Here's a summary of session commands you should know: | + | ## Concepts |
| - | + | ||
| - | - `tmux` - Create a new session (you run this in the terminal) | + | |
| - | - `tmux attach` - Attach the last session (you run this in the terminal) | + | |
| - | - `Ctrl + b, d` - Detach the current session | + | |
| - | - `Ctrl + b, (` - Switch to previous session | + | |
| - | - `Ctrl + b, )` - Switch to next session | + | |
| - | - `Ctrl + b, :tmux kill-session< | + | |
| - | + | ||
| - | ### Windows | + | |
| - | Windows are part of a session and look somewhat like tabs in a browser. They are listed in the status bar. The one marked with a `*` is your current window, and the one marked with a `-` is the one you were previously at. | + | |
| - | + | ||
| - | You create a new window by pressing `Ctrl + b, c`. This means pressing Ctrl + b, releasing both keys, then pressing c. You'll find that most keybindings are prefixed with Ctrl + b, in contrast to `screen` which is prefixed by Ctrl + a. You can cycle through windows by pressing `Ctrl + b, n` (next window) and `Ctrl + b, p` (previous window). You can jump to a window by pressing `Ctrl + b, < | + | |
| - | + | ||
| - | Here's a summary of window commands you should know: | + | |
| - | + | ||
| - | - `Ctrl + b, c` - Create window | + | |
| - | - `Ctrl + b, n` - Next window | + | |
| - | - `Ctrl + b, p` - Previous window | + | |
| - | - `Ctrl + b, w` - Select a window interactively | + | |
| - | - `Ctrl + b, 0..9` - Jump to a window | + | |
| - | - `Ctrl + b, &` - Kill a window | + | |
| - | + | ||
| - | ### Panes | + | |
| - | Panes are part of a window and may be tiled. When you create a window you get a single pane. | + | |
| - | + | ||
| - | Here's a summary of pane commands you should know: | + | |
| - | + | ||
| - | - `Ctrl + b, "` - Split the pane into two, top and bottom | + | |
| - | - `Ctrl + b, %` - Split the pane into two, left and right | + | |
| - | - `Ctrl + b, {` - Swap the current pane with the previous pane | + | |
| - | - `Ctrl + b, }` - Swap the current pane with the next pane | + | |
| - | - `Ctrl + b, x` - Kill a pane | + | |
| - | - `Ctrl + b, z` - Toggle zoom in on a pane | + | |
| - | - `Ctrl + b, q` - Briefly display pane indexes | + | |
| - | + | ||
| - | ## Source code | + | |
| - | | + | 1. [[tmux-sessions|Sessions]] |
| + | 2. [[tmux-windows|Windows]] | ||
| + | 3. [[tmux-panes|Panes]] | ||
| + | 4. [[tmux-key-bindings|Key bindings]] | ||
| + | 5. [[tmux-copy-mode|Copy mode]] | ||
| + | 6. [[tmux-command-mode|Command mode]] | ||
| + | 7. [[tmux-configuration|Configuration]] | ||
| + | 8. [[tmux-layouts|Layouts]] | ||
| + | 9. [[tmux-scripting|Scripting]] | ||
| + | 10. [[tmux-plugins|Plugins]] | ||
wiki/tmux.md · Last modified: by 127.0.0.1
