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

CapturedLine

One line of a capture, with what tmux knows about it.

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

Description#

Built by Pane::capture_lines(). The marks come from the OSC 133 sequences a shell emits around its prompt, so they are present only when the pane's shell emits them.

Examples#

use libtmux::{CaptureOptions, CapturedLine};
let guard = libtmux::test::TestServer::new().await?;
let server = guard.server();
let session = server.new_session("marked").await?;
let pane = session.panes().await?.remove(0);
if server.capabilities().await?.tmux_version().has_behavior(&libtmux::since::CAPTURE_LINE_FLAGS) {
let lines: Vec<CapturedLine> = pane.capture_lines(CaptureOptions::visible()).await?;
assert!(lines.iter().all(|line| !line.starts_output || !line.starts_prompt));
}
guard.shutdown().await?;

Fields4#

CapturedLine fields
NameTypeDescription
starts_output bool Whether a command's output begins on this line.
starts_prompt bool Whether a shell prompt begins on this line.
text TmuxText The line's text, without the flags tmux prefixed to it.
wrapped bool Whether the line continues onto the next row rather than ending.
Esc

Type to search.

Reference previewOpen reference