src.WorkspaceBuilder
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
-
Creates tmux sessions from workspace configurations.
Discussed in Rust workspace internals , Use the Rust workspace builder , Rust workspace builder API
Members
-
Build workspaces on one server.
Discussed in Use the Rust workspace builder
-
Describe what building this workspace would do, without doing it.
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")));Discussed in Control mode vs one-shot · Use the Rust workspace builder , Rust workspace builder behavior , Rust workspace builder API
-
Create the session a workspace describes, and return it.
Windows and panes are created in the order the configuration lists them. Nothing is attached: the caller decides whether to take over a terminal.
Errors
Returns an error when a session of the same name exists, or when tmux refuses any step.
Discussed in Use the Rust workspace builder , Rust workspace builder behavior , Rust workspace builder API
In other ports Build a session from a workspace description
- Python
tmuxp.workspace.builder.ClassicWorkspaceBuilder.build - Ruby
LibTmux::Workspace::Plan#apply - Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript
builder.applyWorkspace - Go
workspace.Build - Java
io.github.libtmux.workspace.WorkspaceBuilder.WorkspaceBuilder.build - .NET
LibTmux.Workspace.WorkspaceBuilder.BuildAsync - C++
libtmux::workspace::build - Swift
WorkspaceBuilder.build(_:on:)
- Python