A beginner’s guide to Tmux: a multitasking superpower for your terminal
Source: Towards Data Science
Introduction
One of the new things I’ve come across recently while researching command‑line‑based coding assistants is a tool I hadn’t heard of before: Tmux, the Terminal Multiplexer.
In the simplest possible terms, Tmux lets you split a single terminal window into multiple windows and panes, each of which is a fully functional terminal. Adoption of tools like Tmux has surged, largely because agent‑team workflows in command‑line coding products (e.g., Claude Code, Google’s Gemini CLI, OpenAI’s Codex) rely on it.
When a product such as Claude Code creates multiple agents to carry out work, it can assign each agent to its own pane. These visual clues make it much easier for humans to keep track of what’s happening as agentic workloads progress. Claude Code will spin up as many separate terminal panes as needed, assign each agent a pane, and automatically close each pane when the agent finishes. In many cases, it uses Tmux for this terminal management.
Since more workloads will likely be carried out with multiple agents in the future, you’ll probably see and use Tmux more often. It makes sense to learn a bit more about what Tmux is and what it can do outside of coding platforms. In the rest of this article I’ll explain how to download Tmux and show some typical operations you can perform with it. I’ll cover only the most important concepts and include a link to the Tmux GitHub repository at the end for deeper exploration.
Note: Other than being a user of them, I have no association or affiliation with any of the products or companies mentioned in this article.
Tmux Licensing
Tmux is open‑source and completely free to use. Each source‑code file in the repository contains the following license:
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Installing Tmux
Depending on your operating system, install Tmux using one of the methods below.
macOS
The easiest way is via Homebrew:
brew install tmux
Ubuntu / Debian / Linux Mint
sudo apt update
sudo apt install tmux
Fedora / CentOS / RHEL
sudo dnf install tmux # dnf (Fedora, newer RHEL/CentOS)
# or
sudo yum install tmux # yum (older RHEL/CentOS)
Windows
Windows does not support Tmux natively, but you can run it through the Windows Subsystem for Linux (WSL):
- Install a WSL Linux distribution (e.g., Ubuntu) from the Microsoft Store.
- Open the WSL terminal.
- Run:
sudo apt install tmux
Key Tmux Terms You Should Understand
These are the foundational concepts; almost everything else builds on them.
- Sessions – Persistent workspaces that survive disconnects. You can detach and later re‑attach to a session.
- Windows – Virtual desktops inside a session. You might have one window for “Coding” and another for debugging.
- Panes – Sub‑windows within a window, arranged vertically or horizontally. Each pane is a mini terminal in its own right.
A major advantage of Tmux is the ability to attach and detach sessions. When you detach, everything continues running in the background; when you re‑attach, you see the updated state.
Verifying Your Installation
After installing, confirm that Tmux works by checking its version:
$ tmux -V
tmux 3.2a
Starting a Tmux Session
The “hello world” of Tmux is simply starting a session:
$ tmux
You’ll notice a green status bar at the bottom of your terminal, indicating you’re now inside a Tmux session. You can run regular OS commands as usual. For example, to list directories:

Image by Author
Inside a Tmux window or pane, list all sessions with:
$ tmux ls
0: 3 windows (created Tue Feb 10 18:22:12 2026)
2: 1 windows (created Tue Feb 10 19:11:12 2026)
3: 1 windows (created Wed Feb 11 10:42:16 2026) (attached)
session2: 2 windows (created Tue Feb 10 18:29:23 2026)
To kill sessions:
# Kill a specific session
$ tmux kill-session -t
# Kill EVERY session (the “nuke” option)
$ tmux kill-server
Executing Tmux Built‑In Commands
Tmux uses a prefix key combination to invoke its built‑in commands. By default the prefix is Ctrl + b, followed by a single character. Common commands include:
| Action | Command (after prefix) |
|---|---|
| Split screen vertically | % |
| Split screen horizontally | " |
| Move to the next pane | o |
| Close the current pane | x |
| Create a new window | c |
| Switch to the next window | n |
| Rename the current window | , |
| Detach from the session | d |
| List all key bindings | ? |
Example: To split the current pane vertically, press Ctrl + b, release, then press %.
Further Reading
- Tmux GitHub repository:
Feel free to explore the documentation and experiment with the commands above. Happy multiplexing!
Tmux Cheat Sheet
| Action | Shortcut |
|---|---|
| Split window vertically | Ctrl‑b " |
| Split window horizontally | Ctrl‑b % |
| Move to another pane | Ctrl‑b + ←/→/↑/↓ |
| Kill current window | Ctrl‑b & |
| Exit tmux (detach) | Ctrl‑b d |
Example 1 – Creating New Panes
-
Start a tmux session.
-
Press Ctrl‑b then % to split the current window vertically.

-
Press Ctrl‑b then ” to split the current pane horizontally.

The name of the current window is shown in the status bar at the bottom. By default windows are numbered starting from 0, but you can rename them.
To close the active pane, press Ctrl‑b then x. A confirmation prompt appears in the status bar.
Example 2 – Creating New Windows
- New window:
Ctrl‑b c - Next window:
Ctrl‑b n(or previous:Ctrl‑b p) - Jump to a specific window:
Ctrl‑b
To close a window, press Ctrl‑b then & and confirm the prompt.
Example 3 – Moving Between Panes & Enabling the Mouse
-
Keyboard navigation:
Ctrl‑b+ arrow key (repeat each time you move). -
Enable mouse support:
Ctrl‑b : :set -g mouse onAfter the command, you can click panes to focus them and click window names in the status bar to switch windows.
Example 4 – The Tmux Configuration File
Settings added via the command line are session‑specific. To make them permanent, place them in ~/.tmux.conf.
# Enable mouse support permanently
echo "set -g mouse on" >> ~/.tmux.conf
To apply the change without restarting tmux:
- Press
Ctrl‑b :to open the command prompt. - Type
source-file ~/.tmux.confand press Enter.
Tmux automatically reads ~/.tmux.conf on startup.
Example 5 – Detaching & Re‑attaching a Session
-
Detach:
Ctrl‑b d(the session keeps running in the background). -
Re‑attach:
tmux attach
Example 6 – Creating Your Own Ctrl‑b Commands
Use the bind command to map new shortcuts.
# Open the command prompt
Ctrl‑b :
# Bind “m” to enable mouse support and display a message
bind m set -g mouse on \; display 'Mouse: ON'
To make the binding permanent, add it to ~/.tmux.conf:
echo "bind m set -g mouse on \; display 'Mouse: ON'" >> ~/.tmux.conf
Example 7 – Miscellaneous Tips
-
Resize a pane
- With mouse: drag the pane border.
- Without mouse:
Ctrl‑bthen hold Alt while pressing an arrow key.
-
Show all key bindings
Ctrl‑b ?– press c or Esc to exit the help screen. -
Zoom a pane
Ctrl‑b z– toggles zoom for the active pane. -
“Where Am I?” flash
Ctrl‑b q– numbers flash on each pane; typing a displayed number jumps to that pane. -
Swap pane positions
Ctrl‑b {– swap with the previous pane.
Ctrl‑b }– swap with the next pane.
For a complete list of tmux options and commands, see the official tmux manual (man tmux) or the online documentation.
{ } – followed by either an open or closed curly‑brace character ({}). This will exchange the location of the active pane with another pane in the window.
Summary
I think getting to know and using a utility like Tmux is a good addition to have in your developer toolbox. This is reinforced by the fact that we’re starting to see many code‑assistant tools—such as Claude Code—actively using tools like Tmux to display the progress of multi‑agent processes. As command‑line, agentic development workflows flourish, we’ll see more of this type of use case.
This article has only scratched the surface of what the Tmux utility is capable of. Tools like this can take considerable time to become really proficient with, but I think it’s worthwhile to persevere. If you do, you might look back and wonder how you coped without it.
To find out more about Tmux, visit its GitHub page at the following link: