libtmux Reference MCP Search
On this page

pane.Pane.capture

View as Markdown

Module
pane
Declared in
Pane
Package
@libtmux/libtmux
Source
packages/libtmux/src/pane.ts
Other languages
PythonRustGoJava.NETC++Swift
capture ( options : : CaptureOptions ) Promise<readonly string[]>
method [source]
method [source]
capture

Capture this pane's contents as lines.

Examples

const lines = await pane.capture();
lines.at(-1);
In other languages Read a pane’s visible contents

Examples

const lines = await pane.capture();
lines.at(-1);
>>> 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
$

0 declared, 0 inherited

Esc

Type to search.