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

Plan

Operations recorded but not yet run.

Source and package
Qualified name
libtmux::plan::Plan
Module
plan
Package
libtmux
Source
crates/libtmux/src/plan.rs
struct plan.Plan

Examples#

use libtmux::plan::{Plan, RenameWindow, SendKeys};
use libtmux::{PaneId, WindowId};
let mut plan = Plan::new();
plan.add(SendKeys::new("%1".parse::<PaneId>()?).text("clear").enter());
plan.add(RenameWindow::new("@1".parse::<WindowId>()?, "ready"));
// Nothing has run: the plan can be read first.
let rendered = plan.preview();
assert_eq!(rendered.len(), 2);
assert!(rendered[0].as_ref().is_some_and(|c| c.summary().to_string().contains("send-keys")));

Members10#

Common operations5#

  • preview method Render every operation without running any of them.
  • add method Record one operation and return a handle to what it creates.
  • run_over_control_mode method Run this plan over an open control-mode connection.
  • validate method Check every step before a run can change tmux state.
  • chain method Record an operation that is allowed to share a tmux invocation.

Other members5#

  • is_empty method Whether nothing is recorded.
  • len method How many operations are recorded.
  • new method Start an empty plan.
  • run method Run this plan, grouping it with planner.
  • steps method The recorded operations, in order.

Guides#

Pages that discuss Plan.

Esc

Type to search.

Reference previewOpen reference