# libtmux::capture_lines

- **Module:** libtmux
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/include/libtmux/capture.hpp#L31
- **Page:** https://libtmux.org/en/cxx/latest/reference/libtmux-capture_lines/

```
libtmux::capture_lines(typename Text, Text &&) -> typename Text
```

The lines are views into the text, so text that dies at the semicolon takes them with it — and `pane.capture()` returns its output by value, which makes `capture_lines(*pane.capture())` the natural thing to write and a use-after-free to run.

Deleted for an rvalue string only: an lvalue string converts as before, and so does a literal.
