libtmux.workspace:apply-workspace
- (apply-workspace client workspace &key cancel-token (timeout nil timeout-p) (output-limit nil output-limit-p) (total-timeout nil total-timeout-p))
-
Public owner:
libtmux.workspaceCreate or reuse WORKSPACE through explicit CLIENT and return WORKSPACE-RESULT. The function first calls FETCH-SNAPSHOT and PLAN-WORKSPACE. A proven match returns immediately with no command outcomes. A missing session executes each planned core mutation once, in order, then captures and proves the final topology. TIMEOUT and OUTPUT-LIMIT, when supplied, apply separately to each core operation; CANCEL-TOKEN is shared. Conflicts dispatch no mutation.
Description#
TOTAL-TIMEOUT, when supplied, is a nonnegative finite number of seconds shared across the application. Each acquisition and core step receives the smaller of its remaining total budget and TIMEOUT or the client's default. The budget is also checked after initial and final planning. Zero refuses the initial read; omission adds no application budget. OUTPUT-LIMIT remains per operation.
This budget controls admission at workspace boundaries. Preparation before a core timer starts, synchronous platform calls and additive cleanup can let an admitted core call run or dispatch past it; caller wall time is not bounded. Boundary expiry before the first core-step invocation signals WORKSPACE-DEADLINE-EXCEEDED directly. Execution begins with that invocation, which can itself fail before dispatch. Later expiry becomes WORKSPACE-APPLY-FAILED's cause, retaining completed outcomes. It does not imply an uncertain command effect.
Failure within a core step or later signals WORKSPACE-APPLY-FAILED. RESULT-OUTCOMES retains every dispatched outcome, including one whose post-command observation cannot advance workspace state; FAILED-STEP identifies the failed or unstarted next step. Final-verification failure has no failed step. No rollback or automatic retry occurs.
See also:
libtmux.workspace:failed-step,libtmux.workspace:plan-workspace,libtmux.workspace:result-outcomes,libtmux.workspace:result-snapshot,libtmux.workspace:workspace-deadline-exceeded.- Parameters
Guides#
Pages that discuss apply-workspace.
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. |
| 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. |
| Perl | Lib Loads through installed public core APIs; existing-target policy and known owned rollback effects are explicit. |
No equivalent is recorded in Lua, Erlang, Elixir, Clojure, Kotlin, Scala or F#.