Snapshot pane

snapshot_pane

snapshot_pane
readonly tool
readonly tool
snapshot_pane

Snapshot a tmux pane: visible terminal output, cursor, mode, scroll.

Returns:

PaneSnapshot

Use when you need a complete picture of a pane in a single call — visible text plus cursor position, whether the pane is in copy mode, scroll offset, and scrollback history size. Replaces separate capture_pane + get_pane_info calls when you need to reason about cursor location or terminal mode.

Avoid when you only need raw text — capture_pane is lighter.

Side effects: None. Readonly.

Example:

{
  "tool": "snapshot_pane",
  "arguments": {
    "pane_id": "%0"
  }
}

Response:

{
  "pane_id": "%0",
  "content": "$ npm test\n\nPASS src/auth.test.ts\nTests: 3 passed\n$",
  "cursor_x": 2,
  "cursor_y": 4,
  "pane_width": 80,
  "pane_height": 24,
  "pane_left": 0,
  "pane_top": 0,
  "pane_right": 79,
  "pane_bottom": 23,
  "pane_at_left": true,
  "pane_at_right": true,
  "pane_at_top": true,
  "pane_at_bottom": true,
  "pane_tty": "/dev/pts/5",
  "pane_in_mode": false,
  "pane_mode": null,
  "scroll_position": null,
  "history_size": 142,
  "title": null,
  "pane_current_command": "zsh",
  "pane_current_path": "/home/user/myproject",
  "is_caller": false
}

The geometry block (pane_left / pane_top / pane_right / pane_bottom and the four pane_at_* predicates) is fetched in the same display-message round-trip as the cursor and mode fields, so there is no extra tmux call. To target a layout-relative pane (e.g. “the bottom-right pane”) use find_pane_by_position instead of computing edges from this snapshot.

Parameters

Parameter

Type

Required

Default

Description

pane_id

str

no

Pane ID (e.g. ‘%1’).

session_name

str

no

Session name for pane resolution.

session_id

str

no

Session ID (e.g. ‘$1’) for pane resolution.

window_id

str

no

Window ID for pane resolution.

max_lines

int

no

500

Maximum number of content lines to return. Defaults to :data:libtmux_mcp.tools.pane_tools.io.CAPTURE_DEFAULT_MAX_LINES. Pass None to return the full capture untrimmed.

socket_name

str

no

tmux socket name.