Find pane by position

find_pane_by_position

find_pane_by_position
readonly tool
readonly tool
find_pane_by_position

Find the pane occupying a corner of a tmux window.

Returns:

PaneInfo

Use when you need to act on a layout-relative pane — “the bottom-right pane”, “whichever pane is in the top-left” — without listing every pane and computing geometry yourself.

Avoid when you already know the pane_id. Use get_pane_info or select_pane directly.

Side effects: None. Read-only.

Example:

{
  "tool": "find_pane_by_position",
  "arguments": {
    "corner": "bottom-right",
    "window_id": "@0"
  }
}

Response is a PaneInfo for the pane occupying that corner. The new geometry fields make the result self-describing:

{
  "pane_id": "%3",
  "pane_left": 40,
  "pane_top": 12,
  "pane_right": 79,
  "pane_bottom": 23,
  "pane_at_left": false,
  "pane_at_right": true,
  "pane_at_top": false,
  "pane_at_bottom": true,
  "pane_tty": "/dev/pts/5"
}

Tie-break. When multiple panes satisfy both edge predicates (a single-pane window touches every edge; some custom layouts can produce ambiguous corners) the visually innermost pane wins — the one with the largest pane_left + pane_top.

Parameters

Parameter

Type

Required

Default

Description

corner

PaneCorner

yes

One of 'top-left', 'top-right', 'bottom-left', 'bottom-right'.

window_id

str

no

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

window_index

str

no

Window index. Requires session_name or session_id.

session_name

str

no

Session name.

session_id

str

no

Session ID.

socket_name

str

no

tmux socket name.