LibTmux.Workspace.WorkspaceBuilder
-
Plans and applies tmux sessions from tmuxp workspace files.
Description#
The tmux-workspace CLI uses a separate builder with a wider document language.
Discussed in Use the C# workspace builder , C# workspace builder API
Members
- ApplyAsync ( plan : Workspace
Plan , cancellationToken : CancellationToken ) Task<WorkspaceResult > -
Applies the reviewed actions and records their individual outcomes.
Description#
Native defaults and hooks remain runtime dependencies. Input acknowledgement is not program completion. Cleanup uses only returned native identities; unknown creations and irreversible shell effects remain visible in the journal.
- Parameters
-
-
plan ( Workspace
Plan ) – The immutable plan for this builder's resolved endpoint. -
cancellationToken ( Cancellation
Token ) – Stops further application and cancels the current operation.
-
- Returns
-
The materialized session, created windows and complete action journal.
- Raises
-
-
Argument
Exception – The plan selects another endpoint. -
Workspace
Operation – The caller canceled application; the exception carries state and action journals.Canceled Exception -
Workspace
Build – Preconditions, application or owned cleanup failed.Exception
-
Discussed in C# workspace builder behavior , C# workspace builder API
- Validate ( workspace : Workspace
File , options : WorkspacePlan ? ) voidOptions -
Checks declaration and policy constraints without reading tmux or executing scripts.
Description#
Reuse defers host-script admission until planning determines whether creation is needed. Layout syntax, checksums and minimum cell counts are checked locally; version-specific layout names are checked during planning. Endpoint identity, conflicts, paths on disk, shell syntax and tmux option support are not checked by local validation.
- Parameters
-
-
workspace ( Workspace
File ) – The immutable declaration to check. -
options ( Workspace
Plan ? ) – The policies that will be used for planning.Options
-
- Raises
-
-
Workspace
Format – The declaration cannot be applied under the supplied policies.Exception -
Argument
Exception – A declaration argument or policy value is invalid.
-
- PlanAsync ( workspace : Workspace
File , options : WorkspacePlan ? , cancellationToken : CancellationOptions Token ) Task<WorkspacePlan > -
Observes the endpoint and constructs an immutable workspace action plan.
- Parameters
-
-
workspace ( Workspace
File ) – The immutable declaration, resolved explicitly when file-relative paths are needed. -
options ( Workspace
Plan ? ) – The conflict, readiness and cleanup policies.Options -
cancellationToken ( Cancellation
Token ) – Cancels read-only endpoint observation.
-
- Returns
-
The actions and observed identity preconditions; no workspace actions are executed.
- Raises
-
-
Workspace
Format – The declaration cannot be applied.Exception -
Tmux
Session – The default policy refuses an existing session.Exists Exception -
Argument
Exception – The endpoint has an opaque initializer or the options are invalid.
-
Discussed in C# workspace builder API
-
Initializes a builder against one server.
- Parameters
-
-
server ( Server ) – The endpoint inspected by plans and used during application.
-
- BuildAsync ( workspace : Workspace
File , cancellationToken : CancellationToken ) Task<WorkspaceResult > -
Plans and applies a workspace with the default policies.
Description#
Uses the same plan and application engine as explicit PlanAsync and ApplyAsync. Input is sent immediately, without claiming shell readiness or command completion. Use an explicit plan to review actions or select readiness, conflict, host-script and compensation policies.
- Parameters
-
-
workspace ( Workspace
File ) – The workspace to build. -
cancellationToken ( Cancellation
Token ) – Cancels planning or application.
-
- Returns
-
The materialized result and complete action journal.
- Raises
-
-
Workspace
Format – The workspace declaration is invalid.Exception -
Tmux
Session – The requested session already exists.Exists Exception -
Workspace
Operation – The caller canceled application; the exception carries state and action journals.Canceled Exception -
Workspace
Build – Application failed; the exception carries the action journal.Exception
-
Discussed in C# workspace internals , C# workspace builder examples , Use the C# workspace builder , C# 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 - Rust
src.WorkspaceBuilder.build - Go
workspace.Build - Java
io.github.libtmux.workspace.WorkspaceBuilder.build - C++
libtmux::workspace::build - Swift
WorkspaceBuilder.build(_:on:) - Kotlin No source-verified Kotlin equivalent is recorded for this operation.
- Scala No source-verified Scala equivalent is recorded for this operation.
- F# No source-verified F# equivalent is recorded for this operation.