On this page
pane.observe.Pane.capture
- Module
- pane.observe
- Declared in
- Pane
- Package
- libtmux
- Source
- crates/libtmux/src/pane/observe.rs
- Other languages
- PythonTypeScriptGoJava.NETC++Swift
-
Capture the pane's visible contents, one entry per line.
Lines are [
TmuxText] because a terminal's contents are arbitrary bytes, not guaranteed UTF-8.Errors
Returns an error when tmux refuses the command.
In other languages Read a pane’s visible contents
- Python
libtmux.Pane.capture_pane - TypeScript
pane.Pane.capture - Go
tmux.Pane.Capture - Java
io.github.libtmux.Pane.Pane.capture - .NET
LibTmux.Pane.CaptureAsync - C++
libtmux::Pane::capture - Swift
Server.capture(_:since:limit:)
- Python
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