LibTmux::Workspace::load
- sub load($self, %args)
-
load(server => $server, existing => 'error'|'skip')uses publicLibTmux::Serveroperations. It checks all session-name conflicts before creation.errorrejects any existing target withConflict;skipleaves that entire session alone, so repeated application creates only absent sessions. A missing server permits explicit creation; other acquisition failures propagate.Description#
Return one report containing created IDs, skipped names, and completed steps. On failure, rollback only sessions returned by successful creation, then throw
Loadwith original cause and partial-effect report. An uncertain creation without a returned ID cannot be rolled back safely. Existing resources are never rollback targets. Layouts apply after splitting; working directories and environments reach every initial process. Completion means command acceptance and captured state, not application readiness.Methods#
Examples#
Complete installed-package program with an owned tmux fixture and result/cleanup assertions. View source
use v5.44;use FindBin;use lib "$FindBin::Bin/../scripts/lib";use LibTmuxFixture;use LibTmux::Workspace;LibTmuxFixture->run(sub ($server, $root) {my $workspace = LibTmux::Workspace->new(config => {schema => 'libtmux.workspace/v1',sessions => [{name => 'workspace-example',windows => [{name => 'api',cwd => $root,layout => 'even-horizontal',panes => [{command => ['/bin/sleep', '120']},{command => ['/bin/sleep', '120'],horizontal => true},],}],}],});die 'plan mutated state' if $workspace->plan->{mutates};my $loaded = $workspace->load(server => $server);die 'load failed' unless $loaded->{status} eq 'loaded';die 'panes missing' unless $server->snapshot->panes->count == 2;die 'repeat did not skip'unless $workspace->load(server => $server, existing => 'skip')->{skipped}->@* == 1;say 'workspace load and repeat: ok';});
In other ports#
Build a session from a workspace description
| Language | Equivalent |
|---|---|
| Python | tmuxp |
| Ruby | Lib |
| PowerShell | Lib Applies the exact reviewed -Plan after PowerShell confirmation. -WhatIf previews without applying it; application is detached. |
| Julia | Lib Applies a prepared WorkspacePlan on an explicit Server, detached and under one deadline. Existing session names fail unless reuse is explicit. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| Common Lisp | libtmux |
| TypeScript | builder |
| Rust | src |
| Go | workspace |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Workspace |
| OCaml | Libtmux Apply a validated Plan through submit, then await its retained execution receipt. Inspect preserves partial and late outcomes. |
No equivalent is recorded in Lua, Erlang, Elixir, Clojure, Kotlin, Scala or F#.