# 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/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/pane_capture.go#L137
- **Page:** https://libtmux.org/en/go/latest/reference/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.
