Pane.capture_with
Read the pane's contents, choosing how much and in what form.
Source and package
- Qualified name
-
libtmux::pane:: Pane:: capture _with - Module
- pane
- Declared in
Pane- Package
- libtmux
- Source
- crates/libtmux/src/pane/observe.rs
-
Description#
Pane::capture()reads the visible screen. This reaches into scrollback, which is where the output a caller is looking for has usually gone by the time anyone asks.Errors
Returns an error when tmux refuses the capture, which includes a pane that has been closed.
Examples#
use libtmux::CaptureOptions;let session = server.new_session("captured").await?;let pane = session.panes().await?.remove(0);let visible = pane.capture_with(CaptureOptions::visible()).await?;let everything = pane.capture_with(CaptureOptions::history()).await?;assert!(everything.len() >= visible.len());let last_ten = pane.capture_with(CaptureOptions::visible().start(-10)).await?;assert!(last_ten.len() >= visible.len());- Parameters
tmux command#
The tmux commands behind capture_with.
tmux C API#
The C declarations in tmux that implement these commands.