# libtmux::capture_lines

- **Module:** libtmux
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/85e8bd603a322dc32bb8b9aeb1a72bcf36945f1d/include/libtmux/capture.hpp#L31
- **Page:** https://libtmux.org/reference/cxx/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.
