Workspace ManagerconceptAPI Reference

Choose documentation 2

latest

Current version

latest
English

Unreleased libtmux has not been released. Its API may change during development. This site's structure and URLs may change too.

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.workspace

Create 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.

Guides#

Pages that discuss apply-workspace.

In other ports#

Build a session from a workspace description

Equivalents of Build a session from a workspace description in other languages
Language Equivalent
Python tmuxp.workspace.builder.ClassicWorkspaceBuilder.build
Ruby LibTmux::Workspace::Plan#apply
PowerShell LibTmux.Workspace\Invoke-TmuxWorkspace Applies the exact reviewed -Plan after PowerShell confirmation. -WhatIf previews without applying it; application is detached.
Julia LibTmuxWorkspace.apply 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.applyWorkspace
Rust src.WorkspaceBuilder.build
Go workspace.Build
Java io.github.libtmux.workspace.WorkspaceBuilder.build
C# LibTmux.Workspace.WorkspaceBuilder.BuildAsync
C++ libtmux::workspace::build
Swift WorkspaceBuilder.build(_:on:)
OCaml Libtmux_unix.Workspace.await Apply a validated Plan through submit, then await its retained execution receipt. Inspect preserves partial and late outcomes.
Perl LibTmux::Workspace::load 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#.

Esc

Type to search.

Reference previewOpen reference