libtmux Reference MCP Search
On this page

libtmux::Pane::capture

View as Markdown

Module
libtmux
Declared in
Pane
Package
libtmux-cxx
Source
include/libtmux/entities.hpp
Other languages
PythonTypeScriptRustGoJava.NETSwift
methodreadonlyoverload2 overloads [source]
methodreadonlyoverload2 overloads [source]
capture

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.

In other languages Read a pane’s visible contents

Examples

>>> pane = window.split(shell='sh')
>>> pane.capture_pane()
['$']
>>> pane.send_keys('echo "Hello world"', enter=True)
>>> pane.capture_pane()
['$ echo "Hello world"', 'Hello world', '$']
>>> print(chr(10).join(pane.capture_pane()))
$ echo "Hello world"
Hello world
$
const lines = await pane.capture();
lines.at(-1);

0 declared, 0 inherited

Esc

Type to search.