A beginner’s guide to Tmux: a multitasking superpower for your terminal

Editor
16 Min Read


of the new things I’ve come across recently, while researching command-line-based coding assistants, is the mention and use of a tool I hadn’t heard of before. That tool is called Tmux, which stands for Terminal Multiplexer. 

In the simplest possible terms, Tmux allows you to split up a single terminal window into a number of separate windows and panes, each of which is a terminal in its own right. Adoption of tools like Tmux has surged, largely due to the agent team workflows found in command-line coding agent products like Claude Code. I mention Claude Code here, but all of its main competitors, such as Google’s Gemini CLI and OpenAI’s Codex, either already have or will be working on their own equivalents.

The point is that, in tools like Claude Code, when it creates multiple agents to carry out work, it can assign each agent to its own window pane. These visual clues make it much, much easier ( for humans) to keep track of what is going on as your agentic workloads progress. 
Claude Code will spin up as many separate terminal window panes as needed, assign each agent a pane, and automatically close each pane as the agent completes its work. And in many cases, it’s using Tmux for this terminal management.

Since it’s likely that more and more workloads in the future will be carried out with multiple agents, you’ll probably see and use Tmux more often. So, I think it makes sense to learn a bit more about what Tmux is and what it can do outside of just coding platforms. For the rest of this article, I’ll explain how to download Tmux and show some typical operations you can do with it. I’m only going to cover the most important concepts and will add a link to the Tmux GitHub home page at the end so you can dive deeper if you want.

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 repo has the following licence attached.

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, you can install Tmux in one of the ways below.

macOS The easiest way to install tmux on macOS is via Homebrew. Open your terminal and run:

brew install tmux

Ubuntu / Debian / Linux Mint
On Debian-based distributions, use the apt package manager:

sudo apt update
sudo apt install tmux

Fedora / CentOS / RHEL
For distributions using dnf or yum:

sudo dnf install tmux

Windows
I’m a Windows user, but unfortunately, Windows doesn’t support Tmux natively but you can run it through the Windows Subsystem for Linux (WSL). To do that,

  • Install a WSL Linux distribution (like Ubuntu) from the Microsoft Store.
  • Open the WSL terminal.
  • Use the Ubuntu command: sudo apt install tmux.

Key Tmux terms you should understand

These are the foundational ideas of tmux, and almost everything else builds on them.

  • Sessions. Persistent workspaces that survive disconnects. You can detach and reattach later.
  • Windows: These are your virtual desktops. You might have one window dedicated to “Coding” and another for debugging.
  • Panes. Sub-windows within a window. They can be oriented either vertically or horizontally. Each pane is a mini command-line terminal in its own right.

One of the key advantages of Tmux is that you can attach and detach sessions. When you detach a session, whatever it’s running will remain running in the background, and when you re-attach to the session, you’ll see the updated state of whatever the session was already doing. 

Verifying your Installation

Once the installation is complete, you can verify that it’s working by checking the version:

$ tmux -V

tmux 3.2a

Starting a Tmux session

The “hello world” of using Tmux is simply starting a session.

$ tmux

Nothing much will change, but you’ll notice a green status bar appear at the bottom of your terminal window, indicating that you are now inside a tmux session. You can type in regular operating system commands from here. For example list all my directories,

Image by Author

Inside a Tmux window or pane, you can list all your sessions using the command:

$ 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, type one of the following,

# To kill a specific session:
$ tmux kill-session -t [session_name_or_number]

# Or ... to kill EVERY session (The "Nuke" option):
$ tmux kill-server

Executing Tmux built-in commands

Tmux relies on a “prefix” key combination to execute its built-in commands. By default, this is Ctrl + b, followed usually by a single character. Here are some examples of common commands you’ll use often.

Action                     Command
-------                    -------------------------
Split screen vertically    Ctrl + b then %
Split screen horizontally  Ctrl + b then """
Move to another pane       Ctrl + b then Arrow Keys
Kill current window        Ctrl+b then &
Exit tmux                  Ctrl + then d

Example 1 – Creating new panes

So, having started a Tmux session as above, try typing Ctrl+b followed by the per cent character (%) to split your original window vertically into two panes. You should see something like this.

Now type Ctrl+b followed by the double quote (“) character, and you should see that the new pane has now been split horizontally like this,

Note that the “name” of your current window is always displayed in the status bar at the bottom of the screen. By default, these are simply numbered sequentially starting from 0, but you can rename them if you want.

To close down the active pane, type the command Ctrl+b followed by the x character. On the status bar, you’ll see a prompt asking you to confirm the operation.

Example 2 – Creating new Windows

To create a new window, type Ctrl+b followed by the character c. The new window will overlay and obscure any existing Tmux windows you have displayed. But look at the status bar, and you will see it displays all your window names. To switch between different windows, use the keyboard shortcut Ctrl+b followed by the n (or p) character to go to the next (or previous) window. You can also switch to a specific window number by typing its number in instead of n (or p)

To close down a window, type the Ctrl+b command followed by the ampersand (&) character. The status bar will display a prompt asking you to confirm the operation.

Example 3 – Moving between panes and enabling the mouse

Ok, you created a bunch of panes within a window. Say you need to move between them. Incidentally, note that your current pane is bordered in green, so you always know which one has focus. 

There are two ways to do this. Via the keyboard, you can type Ctrl+b followed by an appropriate arrow key. Note that you must key in this sequence every time you want to move panes.

Using the keyboard like this all the time to move around can become tiresome, but there is a way to use the mouse instead. To enable the mouse, you can type Ctrl+b followed by the colon (:) character. The bottom bar of your screen should turn a different colour, and you’ll see a colon prompt. Type in the following,

: set -g mouse on

After that, you should be able to switch between panes with your mouse just by left-clicking on them. If you have multiple windows open, you can also move between them by left-clicking on the appropriate window name in your status bar.

Example 4 – The Tmux configuration file

The way we set up the mouse in the previous example was done on a per-session basis. This means when we close down Tmux and re-open it, the mouse setting will be gone. To avoid having to set up things like this every time you start Tmux, you can put them in a configuration file in your home directory called .tmux.conf. Like this,

echo "set -g mouse on" > ~/.ftmux.conf

To apply the change immediately without restarting Tmux, run this inside a Tmux terminal: 

Ctrl + b then : then type source-file ~/.tmux.conf.

Otherwise, the next time Tmux starts, it automatically looks for your configuration file and uses it if present.

There’s a bunch of other settings you can put in your configuration file, so I suggest you check the Tmux doc link at the end for a full list.

Example 5- Detaching a session

This is the superpower of Tmux, but there’s not a lot to it really. You can start a process (like a big download), “detach” from it, close your terminal app, and it keeps running in the background, ready to be displayed when you re-attach to it. To detach a session, type Ctrl+b followed by the character d. Once a session is detached, you re-attach by typing this into any regular terminal command window:

$ tmux attach

Example 6- Creating your own Ctrl+b commands

To create custom Ctrl+b commands, use the Tmux bind command. For example, suppose you want to create a shortcut key sequence to enable mouse support whenever you type Ctrl+b followed by the m character. Type the following commands in,

# get to the command line on the status bar first
Ctrl+b :
# Now map pressing Ctrl+b m to turn the mouse ON
bind m set -g mouse on \; display 'Mouse: ON'

Again, this would turn on the mouse ON key mapping for the current session only. To make it available in every Tmux session, place the bind command in the .tmux.conf file.

echo "bind m set -g mouse on \; display 'Mouse: ON'" >> .tmux.conf

Example 7- Miscellaneous tips

  • Resizing a pane. Assuming you have the mouse enabled, to resize a pane, simply left-click on its border with another pane and drag left-right or up-down as required. If the mouse is not enabled, type Ctrl+b, then hold down the ALT key whilst pressing one of the arrow keys.
  • Getting help. Display all Ctrl-b commands by typing Ctrl+b followed by the question mark (?) character. To exit this display, type the c or ESC key
  • Zooming in. If you have multiple panes open, pressing Ctrl+b followed by the z character will make the current, active pane fill the whole window. Pressing the same key combination again will restore things to the way they were.
  • The “Where Am I?” Flash. If you have a screen full of panes and you lose track of which is which, press Ctrl+b then q. Large numbers will flash over every pane. Not only does this show you the number of each pane, but if you type the number while it’s displayed, you’ll instantly jump to that pane and make it active.
  • Switching pane positions. To swap pane positions, click Ctrl+b 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:

https://github.com/tmux/tmux

Share this Article
Please enter CoinGecko Free Api Key to get this plugin works.