Skip to main content

Understanding Windows

In tmux, a window is a single screen within a session. Each window occupies the entire terminal and can contain one or more panes. Windows are the primary organizational unit for grouping related tasks.
Think of windows like tabs in a web browser - they’re separate workspaces within the same session.

Creating Windows

Basic Window Creation

The simplest way to create a window is with the c key:
From the command line:

Creating Named Windows

Giving windows descriptive names makes navigation easier:
After creating a window with C-b c, rename it with C-b ,

Creating Windows with Commands

Start a window running a specific command:
When the command exits, the window closes by default. Use the remain-on-exit option to change this behavior.

Window Creation Options

Window Selection and Navigation

Quick Selection

The fastest way to switch windows:

Interactive Selection

Programmatic Selection

Window Naming

Manual Naming

Rename the current window:
Or from the command line:

Automatic Naming

By default, tmux automatically renames windows based on the active command. Control this with options:

Setting Names via Escape Sequences

Programs can set the window name:

Moving and Reordering Windows

Moving Windows Between Indexes

Press C-b . then type the destination index:

Swapping Windows

Exchange two windows:

Renumbering Windows

Renumber all windows sequentially:
Renumbering respects the base-index option. If base-index is 1, windows will be numbered 1, 2, 3, etc.

Linking Windows

Windows can be linked to multiple sessions, allowing them to appear in more than one place.

Session Groups

Create sessions that share windows:

Unlinking Windows

A window must be linked to at least one session. You cannot unlink a window from its only session unless you use the -k flag, which will destroy the window.

Killing Windows

Interactive Kill

Command Line Kill

Window Information

Listing Windows

Displaying Window Info

Window Formats

Useful format variables for windows:

Window Options

Configure window behavior with options:

Common Window Options

Advanced Window Management

Find Window Command

Search for windows containing specific text:

Window Layouts

Quickly arrange panes in preset layouts:
Save and restore custom layouts:

Window Status Customization

Customize how windows appear in the status line:

Practical Examples

Development Workspace Setup

Multiple Project Sessions