Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

plan.ops.timing.Pause

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
plan.ops.timing
Package
libtmux
Source
crates/libtmux/src/plan/ops/timing.rs
struct plan.ops.timing.Pause
structoverload [source]
structoverload [source]
struct plan.ops.timing.Pause

Wait before the next operation runs.

Renders run-shell -d SECONDS with no command, which every supported tmux accepts: the client waits out the delay and runs nothing. The wait happens in tmux, so a pause folded into a shared invocation still falls between its neighbours, and a plan pauses in the same place whatever its Planner.

A shell does not need one to catch typed input: tmux holds it until the pane reads it. A pause is for a program that drops what arrives before it is ready.

A control-mode connection cannot carry one, because tmux answers a delayed run-shell there at once and holds the next command instead: Plan::run_over_control_mode , and Plan::run on a handle from Server::over_control_mode, refuse a plan holding a pause with ControlModeErrorKind::BlockingCommand before sending anything.

Examples

use std::time::Duration;
use libtmux::PaneId;
use libtmux::plan::{Pause, Plan, SendKeys};
let pane: PaneId = "%1".parse()?;
let mut plan = Plan::new();
plan.add(SendKeys::new(pane.clone()).text("./start-db").enter());
plan.add(Pause::new(Duration::from_millis(1500)));
plan.add(SendKeys::new(pane).text("./migrate").enter());
let pause = plan.preview().remove(1).ok_or("a pause renders")?;
assert_eq!(pause.summary().to_string(), r#""run-shell" "-d" "1.5""#);

2 declared, 0 inherited

Members

Esc

Type to search.