Workspace ManagerAPI Reference

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

LibTmuxWorkspace.apply

Methods#

Apply detached through public core operations under one monotonic deadline. Existing names fail by default. reuse=SessionRef(...) explicitly borrows that exact session after checking its generation and name. Only newly created panes receive commands. The plan's 1-based positions resolve to returned typed refs.

apply(server, plan; timeout=30.0, cancel=nothing, reuse=nothing,
rollback=:none, readiness=:posix_shell, script_env=ENV, on_event=nothing)

Default readiness sends a marker through a POSIX shell and awaits its atomic publication through an owned file monitor. No polling or delays occur. Cancellation removes the directory, so late producers cannot leave waiters. Custom launchers with input require explicit readiness=:none. A successful command step means input was delivered, not that its shell job finished or succeeded.

rollback=:created attempts uncancelled cleanup within 900 ms: remove the new session, or only created window links in a borrowed session. It does not restore borrowed options/environment, global settings or shell effects. Failed/uncertain creations are never guessed at or deleted. Inspect WorkspaceApplyError.result . Events run synchronously and must return promptly; a callback error stops apply.

Parameters
In other ports Build a session from a workspace description
Esc

Type to search.

Reference preview Open reference