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

builder.applyWorkspace

API reference · Markdown

builder.applyWorkspace ( server : : Server , workspaceInput : : WorkspaceInput , options : : ApplyWorkspaceOptions = {} ) → Promise<Session>
functionasync [source]
functionasync [source]
builder.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
  • ZodError – when the workspace does not satisfy the strict config schema.

  • TypeError – when the operation options are invalid.

  • WorkspaceApplyError – when tmux fails after applying may have started.

Discussed in Workspaces · Build a workspace from a file · TypeScript workspace internals , TypeScript workspace builder API

In other ports Build a session from a workspace description
Esc

Type to search.