libtmux Reference MCP Search
On this page

builder.applyWorkspace

View as Markdown

Module
builder
Package
@libtmux/libtmux
Source
packages/workspace/src/builder.ts
applyWorkspace ( server : : Server , workspaceInput : : WorkspaceInput , options : : ApplyWorkspaceOptions = {} ) Promise<Session>
functionasync [source]
functionasync [source]
applyWorkspace

Build a workspace into a real tmux session, or reconcile one that exists.

tmux gives every new session a window and every new window a pane, so the first window and first pane of each level are adopted rather than created. Creating them anyway is the classic workspace-builder bug that leaves an empty leading window behind.

What this reconciles is *topology*: which windows exist, in what order, under what names, with how many panes, under which layout. It is safe to apply twice and the second run does not duplicate anything. It is deliberately not a process supervisor — see CommandPolicy — and it does not unset options a previous version of the file had set, because tmux cannot say which of an option's current values this file is responsible for.

Raises
  • ZodErrorwhen the workspace does not satisfy the strict config schema.

  • TypeErrorwhen the operation options are invalid.

  • WorkspaceApplyErrorwhen tmux fails after applying may have started.

0 declared, 0 inherited

Esc

Type to search.