Skip to main content
Back to Commands
Pane ManagementPrefix + % (horizontal), Prefix + " (vertical)

split-window

Short form: splitw

Create a new pane by splitting the current pane. The -h flag splits horizontally (creates panes side by side), and -v splits vertically (creates panes above/below).

Synopsis

bash
tmux split-window [-bdfhIvPZ] [-c start-directory] [-e environment] [-F format] [-l size] [-t target-pane] [shell-command]

Options

FlagDescription
-hSplit horizontally (panes side by side)
-vSplit vertically (panes above/below, default)
-bCreate new pane before (left of or above)
-fCreate new pane spanning full width/height
-l sizeSpecify size (lines/columns or percentage)
-c start-directorySpecify starting directory
-dDon't make new pane the active pane

Examples

Split vertically (default)

bash
tmux split-window

Split horizontally (side by side)

bash
tmux splitw -h

Split with 20 lines for new pane

bash
tmux splitw -v -l 20

Split with 30% width for new pane

bash
tmux splitw -h -l 30%

Split in current directory

bash
tmux splitw -c '#{pane_current_path}'

Split and run htop

bash
tmux splitw 'htop'

Default Keybinding

Prefix + % (horizontal), Prefix + " (vertical)

Default prefix is Ctrl+b

Pro Tips

  • Note: tmux's horizontal/vertical is confusing - -h creates a vertical divider (panes side by side)
  • Add these to .tmux.conf for intuitive splits: bind | split-window -h && bind - split-window -v
  • Use -c '#{pane_current_path}' to inherit the current directory