On this page
pane.observe.Pane.capture_with
- Module
- pane.observe
- Declared in
- Pane
- Package
- libtmux
- Source
- crates/libtmux/src/pane/observe.rs
-
Read the pane's contents, choosing how much and in what form.
Pane::capturereads 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());
0 declared, 0 inherited