src.WorkspaceBuilder.plan
-
Describe what building this workspace would do, without doing it.
Description#
The returned plan is inert, so a caller can render it, count what it costs, or explain it before anything reaches tmux. Every object a later step addresses is a forward reference to the step that makes it, so the whole file lowers without a single round trip to look an id up.
Examples#
use tmux_workspace::{Workspace, WorkspaceBuilder};let workspace = Workspace::from_yaml("session_name: devwindows:- window_name: editorpanes:- vim",)?;let server = libtmux::Server::builder().socket_path("/tmp/libtmux-rs-test/plan-example.sock").build()?;let plan = WorkspaceBuilder::new(&server).plan(&workspace);// Nothing has run, but the first command is already known.assert!(plan.preview()[0].as_ref().is_some_and(|command| command.summary().to_string().contains("new-session")));
Guides#
Pages that discuss plan.