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.

method libtmux-rs latest

Plan.run

Run this plan, grouping it with planner.

Source and package
Qualified name
libtmux::plan::Plan::run
Module
plan
Declared in
Plan
Package
libtmux
Source
crates/libtmux/src/plan/run.rs
pub async fn run( &self, server: &Server, planner: Planner ) -> Result<PlanResult, Error>

Description#

The result does not depend on the planner; the number of tmux invocations, and how precisely a failure can be attributed, do.

Errors

Returns an error when tmux cannot be reached, a process cannot be captured, a slot dependency is invalid, or a creating operation does not return valid IDs, or a layout is invalid. Validation happens before the first recorded command. Version-sensitive layouts may query metadata. A command tmux refuses is reported through the returned PlanResult, not as an error, because a plan may expect one.

On a handle from Server::over_control_mode(), a plan holding a super::ops::Pause fails with crate::ControlModeErrorKind::BlockingCommand before anything is sent, as Self::run_over_control_mode() does.

Cancel safety

The effect can be partial: steps already dispatched stay done, and the PlanResult naming them, with the ids of what they created, is lost with the future. A retry runs the whole plan again.

Parameters

tmux command#

The tmux commands behind run.

capture-pane (the plan has a capture-pane step) kill-pane (the plan has a kill-pane step) kill-window (the plan has a kill-window step) new-session (the plan has a new-session step) new-window (the plan has a new-window step) rename-window (the plan has a rename-window step) run-shell (the plan has a run-shell step) select-layout (the plan has a select-layout step) select-pane (the plan has a select-pane step) select-window (the plan has a select-window step) send-keys (the plan has a send-keys step) set-environment (the plan has a set-environment step) set-option (the plan has a set-option step) split-window (the plan has a split-window step)

tmux C API#

The C declarations in tmux that implement these commands.

Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.

Create a session and its first pane

  1. 1 cmd_new_session_exec
  2. calls → 2 spawn_window
  3. calls → 3 spawn_pane
  4. calls → 4 window_add_pane
  5. calls → 5 window_pane_create

Split a window

  1. 1 cmd_split_window_exec
  2. references → 2 spawn_pane
  3. calls → 3 window_add_pane
  4. calls → 4 window_pane_create
Esc

Type to search.

Reference previewOpen reference