Select layout

select_layout

select_layout
mutating tool

Set the layout of a tmux window.

Returns:

WindowInfo

Use when you want to rearrange panes — even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.

Side effects: Rearranges all panes in the window.

Example:

{
  "tool": "select_layout",
  "arguments": {
    "session_name": "dev",
    "layout": "even-vertical"
  }
}

Response:

{
  "window_id": "@0",
  "window_name": "editor",
  "window_index": "1",
  "session_id": "$0",
  "session_name": "dev",
  "pane_count": 2,
  "window_layout": "even-vertical,80x24,0,0[80x12,0,0,0,80x11,0,13,1]",
  "window_active": "1",
  "window_width": "80",
  "window_height": "24"
}

Parameters

Parameter

Type

Required

Default

Description

layout

str

yes

Layout name or custom layout string. Built-in layouts: ‘even-horizontal’, ‘even-vertical’, ‘main-horizontal’, ‘main-horizontal-mirrored’, ‘main-vertical’, ‘main-vertical-mirrored’, ‘tiled’.

window_id

str

no

Window ID (e.g. ‘@1’).

window_index

str

no

Window index within the session.

session_name

str

no

Session name.

session_id

str

no

Session ID.

socket_name

str

no

tmux socket name.