Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

libtmux_mcp.tools.pane_tools.capture_pane

Python
  • Python
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

libtmux_mcp.tools.pane_tools.capture_pane ( pane_id : str | None = None , session_name : str | None = None , session_id : str | None = None , window_id : str | None = None , start : int | None = None , end : int | None = None , max_lines : int | None = CAPTURE_DEFAULT_MAX_LINES , socket_name : str | None = None ) → str
function [source]
function [source]
libtmux_mcp.tools.pane_tools.capture_pane

Capture the visible contents of a tmux pane (terminal scrollback).

Use for tmux pane output — 'capture the build log', 'what did the server print' — not editor file contents. The tool for reading what is displayed in a terminal; use search_panes to search across multiple panes at once.

Output is tail-preserved: when the capture exceeds max_lines the oldest lines are dropped and the returned string is prefixed with a single [... truncated K lines ...] header line so the agent can tell truncation occurred and re-request with a narrower start/end window or a larger max_lines if needed. Pass max_lines=None to disable truncation entirely.

Parameters
  • pane_id ( str | None ) – Pane ID (e.g. '%1').

  • session_name ( str | None ) – Session name for pane resolution.

  • session_id ( str | None ) – Session ID (e.g. '$1') for pane resolution.

  • window_id ( str | None ) – Window ID for pane resolution.

  • start ( int | None ) – Start line number. 0 is the first visible line. Negative values reach into scrollback history (e.g. -100 for last 100 lines).

  • end ( int | None ) – End line number.

  • max_lines ( int | None ) – Maximum number of lines to return. Defaults to CAPTURE_DEFAULT_MAX_LINES. Pass None to return the full capture with no truncation.

  • socket_name ( str | None ) – tmux socket name.

Returns

str Captured pane content as text. When truncated, the first line is a [... truncated K lines ...] marker.

Esc

Type to search.