# libtmux_mcp.tools.pane_tools.snapshot_pane

- **Module:** libtmux_mcp.tools.pane_tools
- **Package:** libtmux-mcp
- **Language:** Python
- **Kind:** function
- **Source:** https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/pane_tools/meta.py#L105
- **Page:** https://libtmux.org/en/py/stable/mcp/reference/libtmux_mcp-tools-pane_tools-snapshot_pane/

```
libtmux_mcp.tools.pane_tools.snapshot_pane(
    pane_id: str | None = None,
    session_name: str | None = None,
    session_id: str | None = None,
    window_id: str | None = None,
    max_lines: int | None = CAPTURE_DEFAULT_MAX_LINES,
    socket_name: str | None = None,
) -> PaneSnapshot
```

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

Use for terminal-contents inspection — 'what's in my pane', 'the
current shell output' — not editor panes or browser viewports.
Returns everything :func:`~libtmux_mcp.tools.pane_tools.capture_pane`
and :func:`~libtmux_mcp.tools.pane_tools.get_pane_info` return, plus
cursor position, [copy-mode](/en/tmux/latest/manual/copy-mode/) state, and scroll position — in a single
call. Prefer this over separate capture_pane + get_pane_info calls
when you need to reason about cursor location or pane mode.

The ``content`` field is tail-preserved: when the captured pane
exceeds ``max_lines``, the oldest lines are dropped and the result
is reported via ``content_truncated`` / ``content_truncated_lines``
fields on the returned :class:`~libtmux_mcp.models.PaneSnapshot`.
Pass ``max_lines=None`` to opt out of 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.
- `max_lines` (`int | None`): Maximum number of content lines to return. Defaults to
``CAPTURE_DEFAULT_MAX_LINES``.
Pass ``None`` to return the full capture untrimmed.
- `socket_name` (`str | None`): tmux socket name.

## Returns

PaneSnapshot
    Rich snapshot with content, cursor, mode, and scroll state.
    When the capture is trimmed, ``content_truncated`` is True and
    ``content_truncated_lines`` gives the number of dropped head
    lines; ``content`` itself carries no marker header.
