Workspace ManagerconceptAPI Reference

Choose documentation 2

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

LibTmux.Workspace\Get-TmuxWorkspacePlan

Observe an explicit endpoint and prepare a workspace plan.

Description#

Validate the native declaration and policies, then inspect the supplied tmux endpoint. Return one native WorkspacePlan containing ordered actions, native requests and observed identity preconditions. Planning does not start a daemon, create panes, send commands or execute the declaration's host script.

Resolve file-relative paths explicitly before planning. Host scripts require a resolved document directory and AllowHostScripts when they will execute. The plan freezes the chosen policies, host limits and command arguments. Review its Actions and CompensationActions, then pass that same plan to Invoke-TmuxWorkspace. Changing a source file does not change an existing plan.

Error refuses a conflicting session. Reuse plans only reuse when that session exists, skipping declaration effects and host execution. Append creates declared windows while preserving local session settings and applying declared global defaults. Global options can affect other sessions that inherit them and are not restored by compensation. Replace selects the exact observed session for replacement. A stale plan fails at application; it is not automatically regenerated.

Observation spans tmux operations and is not a transaction. Native options, layouts, hooks and configuration can still cause application failures.

Notes

All numeric timeout parameters use seconds. Policy validation occurs before endpoint observation. Planning errors preserve the native exception with the Tmux.WorkspacePlanFailed identifier; invalid policy values use Tmux.InvalidWorkspacePolicy.

A JSON window layout needs tmux 3.8. On an earlier daemon planning fails with LibTmux.Workspace.WorkspaceFormatException, whose inner exception is the LibTmux.TmuxUnsupportedOnReleaseException refusal for layout-json, and nothing is created.

Command details#

Command type
cmdlet
Positional binding
Enabled.
Pipeline inputs
LibTmux.Workspace.WorkspaceFile: A parsed declaration, optionally resolved against an explicit document directory.
Outputs
LibTmux.Workspace.WorkspacePlan

Examples#

Example 1 Plan a workspace at an explicit socket without creating its session. View source

Terminal window
$endpoint = LibTmux\New-TmuxServer -SocketPath $SocketPath
LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'
session_name: development
windows:
- window_name: editor
'@ | LibTmux.Workspace\Get-TmuxWorkspacePlan -Server $endpoint
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.Workspace.WorkspacePlan: The native immutable plan with its endpoint and ordered actions.

Guides#

Pages that discuss Get-TmuxWorkspacePlan.

Workspace
Esc

Type to search.

Reference previewOpen reference