Workspace ManagerAPI Reference

Choose documentation 2

latest

Current version

latest
English

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

LibTmux.Workspace\Invoke-TmuxWorkspace

Invoke-TmuxWorkspace [-Plan] <LibTmux.Workspace.WorkspacePlan> [-WhatIf] [-Confirm] [<CommonParameters>]

Apply the exact workspace plan after one confirmation.

Description#

Apply the supplied native WorkspacePlan using its own endpoint, observed identities and frozen actions. No declaration, file, endpoint or policy can be substituted at invocation. Stale preconditions fail; invocation never replans or retries mutations automatically.

One PowerShell ShouldProcess decision covers the whole plan. Its target names the executable, socket and literal session name. Its action describes conflict, startup, readiness and compensation policy, global option effects, then lists every action and conditional cleanup step in order by kind and symbolic target. Option actions disclose scope and whether they change global defaults; request values are omitted. Inspect the original plan for full request and host-command values. WhatIf and declined confirmation perform no application I/O or cleanup and emit no WorkspaceResult.

Successful invocation returns one native WorkspaceResult containing the session, created windows, unsupported layouts and action journals. WorkspaceBuildException remains ErrorRecord.Exception under Tmux.WorkspaceApplyFailed, with the original plan as TargetObject. Inspect its Dispatch , InnerException, PartialResult, Journal and CompensationJournal; partial results are never emitted as success.

Stopping the pipeline cancels owned work. Cleanup follows the plan's frozen budget. A stopped pipeline can suppress subsequent error output, so receiving a cancellation journal after pipeline shutdown is not guaranteed. Application is detached; it does not attach a terminal or transfer ownership of the daemon. To enter the applied session, pass the successful WorkspaceResult.Session to Enter-TmuxSession in a foreground terminal outside tmux. Attachment has its own confirmation and cancellation behavior; it does not repeat application.

Notes

Replace is an explicit planning policy. Compensation can remove only creations whose ownership is established by the native journal; shell and host-script effects cannot be undone. Reuse returns the existing session without running workspace mutation or host actions.

Command details#

Command type
cmdlet
Confirmation
Supports -WhatIf and -Confirm ; confirm impact: High.
Positional binding
Enabled.
Pipeline inputs
LibTmux.Workspace.WorkspacePlan: A native plan prepared by Get-TmuxWorkspacePlan or the shared .NET API.
Outputs
LibTmux.Workspace.WorkspaceResult

Examples#

Example 1 Preview an existing plan created by Get-TmuxWorkspacePlan without applying it. View source

Terminal window
$Plan | LibTmux.Workspace\Invoke-TmuxWorkspace -WhatIf

Example 2 Apply that reviewed plan with the normal confirmation explicitly disabled. View source

Terminal window
$Plan | LibTmux.Workspace\Invoke-TmuxWorkspace -Confirm:$false
Parameters
  • -Plan (LibTmux.Workspace.WorkspacePlan) #

    The exact native plan to apply. Its endpoint, actions, creation identity checks and cleanup policies are preserved.

    Required
    Yes
    Position
    0
    Pipeline input
    By value
    Validation
    ValidateNotNull()
  • -WhatIf (System.Management.Automation.SwitchParameter) #

    Describe the whole plan without tmux inspection, host execution, mutation or cleanup. No success object is returned.

    Required
    No
    Position
    Named
    Pipeline input
    No
    Switch
    Yes
    Aliases
    wi
    Default
    False
  • -Confirm (System.Management.Automation.SwitchParameter) #

    Request normal PowerShell confirmation for the whole reviewed plan. The command has High confirmation impact.

    Required
    No
    Position
    Named
    Pipeline input
    No
    Switch
    Yes
    Aliases
    cf
    Default
    False
Common parameters 12

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

Returns

LibTmux.Workspace.WorkspaceResult: One completed native result. Preview and declined confirmation emit nothing.

Discussed in Workspace guide

In other ports Build a session from a workspace description
Esc

Type to search.

Reference preview Open reference