# libtmux::Pane::capture

- **Module:** libtmux::Pane
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/include/libtmux/entities.hpp#L786
- **Page:** https://libtmux.org/en/cxx/latest/reference/libtmux-pane-capture/

```
libtmux::Pane::capture() -> expected< std::string, CommandFailure >
```

The visible contents, as tmux printed them.

`capture_lines` frames it into lines, and takes a named string: the lines are views into it, so framing this return value directly is a compile error rather than a dangling read.

A pane's scrollback can be far larger than the default bound, and a capture that does not fit is reported rather than cut, so a caller reading history passes the size it is prepared to hold.
