# capture_pane

Source: https://libtmux.org/en/rs/latest/mcp/tools/capture_pane/

> Read a pane's contents. Reads the visible screen by default; set history to reach output that has scrolled off, or give a start and end line. Set last_command to get only what the last command printed, which is usually what you want and is far shorter -- it needs tmux 3.7 and a shell that marks its prompts, and says so when it cannot. Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted.

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Read a pane’s contents. Reads the visible screen by default; set history to reach output that has scrolled off, or give a start and end line. Set last\_command to get only what the last command printed, which is usually what you want and is far shorter — it needs tmux 3.7 and a shell that marks its prompts, and says so when it cannot. Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted.

[All Rust tools](../) · [JSON](../capture_pane.json) · [Source](https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/tmux-mcp/src/tools/inspect.rs#L196)

## Arguments

* `end` optional · integer | null

  End at this line. Omit for the bottom of the screen.

* `history` optional · boolean

  Read the whole history rather than the visible screen.

  Default: `false`.

* `last_command` optional · boolean

  Return only the last command's output, when the shell marks its prompts. Answers far less than the history, because it starts where the last command's output began. When the pane's shell does not mark its prompts -- fish does, bash and zsh do not -- this reports \`marks: "absent"\` and returns the visible screen instead.

  Default: `false`.

* `pane` required · string

  The \`%\`-prefixed pane id.

* `start` optional · integer | null

  Start at this line. Zero is the top of the screen, negative is scrollback. Omit for the top of the screen, or of the scrollback with \`history\`.

## Schemas

The schema defines required fields, nested values, defaults, and validation constraints.
