# tmux.Pane.Capture

- **Module:** tmux.Pane
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/pane_capture.go#L122
- **Page:** https://libtmux.org/reference/go/tmux-pane-capture/

```
tmux.Pane.Capture(ctx: context.Context, request: CapturePaneRequest) -> ([]string, error)
```

Capture captures printed content from the receiver's exact linked pane. It returns a caller-owned slice. A completed nonzero exit or stderr does not become a [CommandError]; any stdout is returned without an error.

This is a point-in-time capture rather than a stream; the zero request reads
the visible screen. It may include a shell's echo of [Pane.SendKeys] input.
Compare whole lines when polling; use [ControlClient.NextNotification] or
[Server.WaitFor] when the application exposes a stream or explicit signal.

Invalid positions fail before execution. Transport and context failures return
any partial stdout with the error.
