Site Tools


wiki:tmux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
wiki:tmux [August 19, 2026 at 16:36] Ivan Janevskiwiki: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 background session that you can attach to. It gives you the ability to create multiple windows within a sessionThen it also gives you the ability to create multiple panes within a window, and tile themEach pane contains a terminal. Thus, you can think of tmux as a  [[window-manager|tiling window manager]] for the terminal. You don't need a graphical user interface at all. You can run tmux inside any terminal, including over [[ssh|SSH]].+**Tmux** is terminal multiplexer that lets you run multiple terminals within one terminalCreate sessions that run in the background, create windows within sessions, and split windows into panesDetach and reattach to sessions anytime—they keep running whether you're connected or not.
  
-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                          create a new session 
-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 `Ctrl + b, d`. This means pressing Ctrl + b, releasing both, then pressing d. As mentioned, you can reattach by running `tmux attachin any terminal.+tmux attach                   # reattach to last session 
 +tmux list-sessions            # list all sessions 
 +tmux new-session -s name      # create named 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 + breleasing both, then pressing Shift + 9 or 0for `(and `)respectively (on English keyboards at least). If you want to kill the session, you press `Ctrl + b, :to enter command mode, type in "kill-session", then hit enter.+The prefix key is `Ctrl+Bby defaultPress itrelease, then press the command (e.g., `Ctrl+Bthen `dto detach). Tmux is highly customizable via `~/.tmux.conf`.
  
-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<CR>` - Kill the current 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, <number>` or by pressing `Ctrl + b, w` and choosing a window interractively. Finally, you can kill a window and all its panes by `Ctrl + b, &`. This means pressing Ctrl + b, releasing the Ctrl key, then pressing Shift + 7, which sends the '&' key. Alternatively, you can kill a window by killing all of its panes. +
- +
-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+
  
- https://github.com/tmux/tmux+ 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