Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

struct libtmux-rs latest

CaptureOptions

How far back a capture reaches, and in what form.

Source and package
Qualified name
libtmux::pane::CaptureOptions
Module
pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
struct pane.CaptureOptions

Description#

Line numbers follow tmux: zero is the top of the visible screen, negative numbers are scrollback, and positive numbers run down the screen.

Examples#

use libtmux::CaptureOptions;
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("capture").await?;
let window = session.active_window().await?.expect("a session has a window");
let pane = window.active_pane().await?.expect("a window has a pane");
// The constructors name the two questions people actually ask, rather
// than making a caller remember that zero is the top of the screen.
let visible = pane.capture_with(CaptureOptions::visible()).await?;
let everything = pane.capture_with(CaptureOptions::history()).await?;
assert!(everything.len() >= visible.len());
guard.shutdown().await?;

Members9#

Common operations3#

  • pending_escape method Capture the escape sequence the pane has begun but not finished.
  • trailing_spaces method Keep the spaces tmux would otherwise strip from each line's end.
  • trim_blank_cells method Drop the positions at each line's end that hold no character at all.

Other members6#

  • end method End the capture at a line.
  • escape_sequences method Keep the terminal escape sequences rather than the text alone.
  • history method Capture everything tmux still holds, scrollback included.
  • join_wrapped method Return a wrapped line as one line rather than as the rows it occupies.
  • start method Start the capture at a line.
  • visible method Capture the visible screen, which is what tmux does by default.
Esc

Type to search.

Reference previewOpen reference