Terminal GuideTerminal Guide

tmux Split Window & Pane Management Guide

Master tmux split windows and pane management. Learn horizontal and vertical splits, pane navigation, resizing, layouts, zoom, synchronized input, and practical workflows.

10 min readLast updated: February 22, 2026
Dai Aoki

Dai Aoki

CEO at init, Inc. / CTO at US & JP startups / Creator of WebTerm

Understanding tmux Splits

One of the most confusing aspects of tmux for newcomers is its split terminology. The naming convention is counterintuitive because tmux names splits based on the direction of the divider line, not the direction the panes are arranged.

The Confusing Terminology

  • split-window -h (or prefix + %) creates a horizontal divider — panes are placed side by side (left/right). The divider runs vertically, but tmux calls this a "horizontal" split because the pane is split along the horizontal axis.
  • split-window -v (or prefix + ") creates a vertical divider — panes are stacked (top/bottom). The divider runs horizontally, but tmux calls this a "vertical" split because the pane is split along the vertical axis.

Think of it this way: -h splits the pane horizontally (cutting it with a vertical line), and -v splits the pane vertically (cutting it with a horizontal line). Here is a visual diagram:

text
# split-window -h (prefix + %)
# "Horizontal split" = panes side by side
# The divider line is vertical: |
+---------------+---------------+
|               |               |
|               |               |
|   Pane 0      |   Pane 1      |
|               |               |
|               |               |
+---------------+---------------+

# split-window -v (prefix + ")
# "Vertical split" = panes stacked
# The divider line is horizontal: ---
+-------------------------------+
|                               |
|           Pane 0              |
|                               |
+-------------------------------+
|                               |
|           Pane 1              |
|                               |
+-------------------------------+
CommandKey BindingDividerPane Arrangement
split-window -hprefix + %Vertical line |Side by side (left/right)
split-window -vprefix + "Horizontal line ---Stacked (top/bottom)

Creating Splits

There are two main ways to create splits in tmux: using command-line commands or key bindings. Both approaches offer the same functionality, but command-line commands provide more precise control over pane size and target.

Command Line Splits

You can create splits from the terminal or from the tmux command prompt (prefix + :):

bash
# Vertical split (panes stacked top/bottom)
tmux split-window -v

# Horizontal split (panes side by side)
tmux split-window -h

# Split with a specific percentage size
# Create a horizontal split where the new pane takes 30% of the width
tmux split-window -h -p 30

# Create a vertical split where the new pane takes 20% of the height
tmux split-window -v -p 20

# Split with an exact size in lines or columns
# New pane will be exactly 80 columns wide
tmux split-window -h -l 80

# New pane will be exactly 10 lines tall
tmux split-window -v -l 10

# Split and run a specific command in the new pane
tmux split-window -v 'tail -f /var/log/syslog'

# Split and run htop in the new pane
tmux split-window -h 'htop'

# Split a specific window (target window 2)
tmux split-window -t :2 -v

Key Binding Splits

The default key bindings for splitting are:

Key BindingActionResult
prefix + %Horizontal splitPanes side by side (left/right)
prefix + "Vertical splitPanes stacked (top/bottom)
prefix + xClose current paneKills the active pane (with confirmation)

The default prefix key is Ctrl + b. So to create a horizontal split, you would press Ctrl + b, release, then press %.

Pane Navigation

Once you have multiple panes open, navigating between them efficiently is essential. tmux offers several methods for moving between panes.

Arrow Key Navigation

The simplest way to navigate between panes is with arrow keys:

bash
# Move to the pane in the given direction
prefix + Up      # Move to pane above
prefix + Down    # Move to pane below
prefix + Left    # Move to pane on the left
prefix + Right   # Move to pane on the right

Vim-Style Navigation

Many users prefer vim-style navigation with h/j/k/l keys. This requires adding bindings to your ~/.tmux.conf:

bash
# Add to ~/.tmux.conf for vim-style pane navigation
bind h select-pane -L    # Move left
bind j select-pane -D    # Move down
bind k select-pane -U    # Move up
bind l select-pane -R    # Move right

After adding these bindings and reloading the config (prefix + : then source-file ~/.tmux.conf), you can use prefix + h/j/k/l to navigate panes.

Other Navigation Methods

Key BindingAction
prefix + oCycle to the next pane
prefix + ;Toggle to the last active pane
prefix + qDisplay pane numbers, then press the number to jump to that pane
prefix + { / prefix + }Swap the current pane with the previous / next pane

You can also enable mouse mode for click-to-focus navigation:

bash
# Enable mouse mode (add to ~/.tmux.conf)
set -g mouse on

# With mouse mode enabled, you can:
# - Click on any pane to focus it
# - Drag pane borders to resize
# - Scroll with the mouse wheel
# - Select text (hold Shift to bypass tmux and use terminal selection)

Resizing Panes

tmux provides multiple methods for resizing panes, from key bindings for quick adjustments to command-line options for precise control.

Key BindingActionResize Amount
prefix + Ctrl + UpResize pane upward1 cell
prefix + Ctrl + DownResize pane downward1 cell
prefix + Ctrl + LeftResize pane left1 cell
prefix + Ctrl + RightResize pane right1 cell
prefix + Alt + UpResize pane upward5 cells
prefix + Alt + DownResize pane downward5 cells
prefix + Alt + LeftResize pane left5 cells
prefix + Alt + RightResize pane right5 cells
bash
# Resize pane using command line (from tmux command prompt or shell)
# Resize down by 10 cells
tmux resize-pane -D 10

# Resize up by 10 cells
tmux resize-pane -U 10

# Resize left by 10 cells
tmux resize-pane -L 10

# Resize right by 10 cells
tmux resize-pane -R 10

# Set exact width (in columns)
tmux resize-pane -x 80

# Set exact height (in rows)
tmux resize-pane -y 24

# Set both width and height at once
tmux resize-pane -x 80 -y 24

# Resize a specific pane (target pane 1 in current window)
tmux resize-pane -t 1 -R 20

Pane Layouts

tmux includes five built-in layouts that automatically arrange panes within a window. You can cycle through them or select a specific layout.

text
# 1. even-horizontal: All panes arranged in equal-width columns
+--------+--------+--------+
|        |        |        |
|        |        |        |
| Pane 0 | Pane 1 | Pane 2 |
|        |        |        |
|        |        |        |
+--------+--------+--------+

# 2. even-vertical: All panes arranged in equal-height rows
+------------------------+
|        Pane 0          |
+------------------------+
|        Pane 1          |
+------------------------+
|        Pane 2          |
+------------------------+

# 3. main-horizontal: One large pane on top, others below
+------------------------+
|                        |
|       Main Pane        |
|                        |
+--------+-------+-------+
| Pane 1 |Pane 2 |Pane 3 |
+--------+-------+-------+

# 4. main-vertical: One large pane on left, others stacked right
+------------+-----------+
|            |  Pane 1   |
|            +-----------+
|  Main Pane |  Pane 2   |
|            +-----------+
|            |  Pane 3   |
+------------+-----------+

# 5. tiled: All panes arranged in a roughly equal grid
+------------+-----------+
|            |           |
|   Pane 0   |  Pane 1   |
|            |           |
+------------+-----------+
|            |           |
|   Pane 2   |  Pane 3   |
|            |           |
+------------+-----------+
Key Binding / CommandAction
prefix + SpaceCycle through the five built-in layouts
prefix + Alt + 1Switch to even-horizontal layout
prefix + Alt + 2Switch to even-vertical layout
prefix + Alt + 3Switch to main-horizontal layout
prefix + Alt + 4Switch to main-vertical layout
prefix + Alt + 5Switch to tiled layout
bash
# Select a specific layout by name
tmux select-layout even-horizontal
tmux select-layout even-vertical
tmux select-layout main-horizontal
tmux select-layout main-vertical
tmux select-layout tiled

# Set the main pane size for main-horizontal and main-vertical layouts
# Main pane height (for main-horizontal)
tmux set-window-option main-pane-height 60%

# Main pane width (for main-vertical)
tmux set-window-option main-pane-width 60%

Zoom and Break

tmux provides powerful features for temporarily maximizing a pane, breaking it out into its own window, or merging panes from different windows.

Key BindingActionDescription
prefix + zToggle zoomTemporarily maximize the current pane to fill the entire window. Press again to restore the original layout.
prefix + !Break paneMove the current pane into a new window of its own.
bash
# Toggle zoom on the current pane (also available via prefix + z)
tmux resize-pane -Z

# Break the current pane into a new window
tmux break-pane

# Break a specific pane into a new window
tmux break-pane -t 2

# Join a pane from another window into the current window
# Move pane from window 2 to the current window (vertical split)
tmux join-pane -s :2

# Move pane from window 2 to window 1 (horizontal split)
tmux join-pane -h -s :2 -t :1

# Move a specific pane (pane 1 from window 3) to the current window
tmux join-pane -s :3.1

# Swap two panes
tmux swap-pane -s 0 -t 1

Zoom is particularly useful when you need to temporarily focus on one pane to view output or edit a file, then return to your multi-pane layout. A zoomed pane shows a Z flag in the status bar.

Synchronized Input

Synchronized panes allow you to type the same input into all panes within a window simultaneously. This is incredibly useful when you need to run the same command across multiple servers or environments.

bash
# Enable synchronized input for all panes in the current window
tmux setw synchronize-panes on

# Disable synchronized input
tmux setw synchronize-panes off

# Toggle synchronized input (useful as a key binding)
tmux setw synchronize-panes

# You can also use the tmux command prompt:
# prefix + : then type:
#   setw synchronize-panes on
#   setw synchronize-panes off

Use Cases for Synchronized Input

  • Multi-server management: SSH into multiple servers in separate panes, enable sync, and run the same commands on all servers at once (e.g., updating packages, checking disk space).
  • Comparing environments: Open panes connected to staging and production, then run the same diagnostic commands to compare outputs side by side.
  • Batch operations: Perform the same file operations across multiple directories or projects simultaneously.
bash
# Practical example: Update packages on 3 servers simultaneously

# 1. Create panes and SSH into each server
tmux new-session -s servers
tmux split-window -v
tmux split-window -v
tmux select-layout even-vertical

# In each pane, SSH to a different server:
#   Pane 0: ssh user@server1
#   Pane 1: ssh user@server2
#   Pane 2: ssh user@server3

# 2. Enable synchronized input
tmux setw synchronize-panes on

# 3. Now any command you type goes to ALL panes:
#    sudo apt update && sudo apt upgrade -y
#    df -h
#    free -m

# 4. Disable sync when done
tmux setw synchronize-panes off

A useful key binding to quickly toggle synchronized input:

bash
# Add to ~/.tmux.conf - toggle sync with prefix + S
bind S setw synchronize-panes

Practical Workflows

Combining splits, layouts, and navigation creates powerful workflows for everyday tasks. Below are common setups that you can adapt to your needs.

Development Environment

A typical development layout with an editor, terminal, and log viewer:

text
# Development layout:
# +----------------------------+----------+
# |                            |          |
# |                            |  Logs    |
# |        Editor              |  tail -f |
# |        (vim/nvim)          |          |
# |                            +----------+
# |                            |          |
# |                            | Terminal |
# |                            |  (shell) |
# +----------------------------+----------+
bash
# Create the development layout
tmux new-session -s dev -d

# Create the right pane (logs) - 35% width
tmux split-window -h -p 35

# Split the right pane vertically for terminal
tmux split-window -v -p 50

# Select the left pane (editor) and open your editor
tmux select-pane -t 0
tmux send-keys 'nvim .' Enter

# Select the top-right pane (logs) and tail logs
tmux select-pane -t 1
tmux send-keys 'tail -f logs/development.log' Enter

# Attach to the session
tmux attach -t dev

Monitoring Setup

A monitoring dashboard with system metrics, logs, and disk usage:

text
# Monitoring layout:
# +----------------------------+----------+
# |                            |          |
# |          htop              | Disk     |
# |    (system monitor)        | Usage    |
# |                            | (watch)  |
# +----------------------------+----------+
# |                            |          |
# |       Log Viewer           | Network  |
# |    (tail -f syslog)        | (iftop)  |
# |                            |          |
# +----------------------------+----------+
bash
# Create the monitoring layout
tmux new-session -s monitor -d

# Split into top and bottom
tmux split-window -v -p 50

# Split top row: left (htop) and right (disk)
tmux select-pane -t 0
tmux split-window -h -p 30

# Split bottom row: left (logs) and right (network)
tmux select-pane -t 2
tmux split-window -h -p 30

# Start commands in each pane
tmux select-pane -t 0
tmux send-keys 'htop' Enter

tmux select-pane -t 1
tmux send-keys 'watch -n 5 df -h' Enter

tmux select-pane -t 2
tmux send-keys 'tail -f /var/log/syslog' Enter

tmux select-pane -t 3
tmux send-keys 'sudo iftop' Enter

# Attach to the session
tmux attach -t monitor

The default split key bindings (% and ") are not intuitive. Many users remap them to | and - which visually represent the direction of the split.

bash
# ~/.tmux.conf - Recommended pane management bindings

# ── Intuitive split bindings ──
# | for vertical divider (side by side)
bind | split-window -h -c "#{pane_current_path}"
bind \ split-window -h -c "#{pane_current_path}"

# - for horizontal divider (stacked)
bind - split-window -v -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"

# ── Vim-style pane navigation ──
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# ── Pane resizing with Shift + arrow ──
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

# ── Quick pane management ──
bind S setw synchronize-panes          # Toggle sync input
bind m resize-pane -Z                  # Toggle zoom (alternative to z)

# ── Open splits in current directory ──
# (already included in bindings above with -c flag)

# ── Mouse mode ──
set -g mouse on

# ── Start window/pane numbering at 1 ──
set -g base-index 1
setw -g pane-base-index 1

# ── Renumber windows when one is closed ──
set -g renumber-windows on

Quick Reference

  • prefix + % - Split side by side (horizontal)
  • prefix + " - Split stacked (vertical)
  • prefix + arrow - Navigate between panes
  • prefix + Ctrl + arrow - Resize pane (small step)
  • prefix + Alt + arrow - Resize pane (large step)
  • prefix + Space - Cycle through layouts
  • prefix + z - Toggle zoom on current pane
  • prefix + ! - Break pane into new window
  • prefix + o - Cycle to next pane
  • prefix + x - Close current pane

Official Documentation

For authoritative information, refer to the official documentation:

Related Articles