# tmux.Pane.CaptureBytes

- **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#L136
- **Page:** https://libtmux.org/reference/go/tmux-pane-capturebytes/

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

CaptureBytes captures printed content from the receiver's exact linked pane as caller-owned stdout bytes. It preserves tmux's output delimiters and trailing newlines after tmux has interpreted the pane's terminal contents.

Its validation and failure behavior match [Pane.Capture], including returning
partial bytes with transport or context errors.
