LibTmux.Workspace\Invoke-TmuxWorkspace
- Invoke-TmuxWorkspace [-Plan] <LibTmux.Workspace.WorkspacePlan> [-What
If ] [-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.
OnePowerShell 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.WhatIfand 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-TmuxSessionin 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
-WhatIfand-Confirm; confirm impact: High. - Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Workspace.WorkspacePlan: A native plan prepared byGet-TmuxWorkspacePlanor the shared .NET API.- Outputs
LibTmux.Workspace.WorkspaceResult
Examples#
Example 1 Preview an existing plan created by
Get-TmuxWorkspacePlanwithout applying it. View sourceTerminal window $Plan | LibTmux.Workspace\Invoke-TmuxWorkspace -WhatIfExample 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 .Switch Parameter 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 .Switch Parameter 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.
-
-Verbose(System.Management ) #.Automation .Switch Parameter Display verbose messages produced by this command.
Aliases:vbMicrosoft Learn reference -
-Debug(System.Management ) #.Automation .Switch Parameter Display debug messages produced by this command.
Aliases:dbMicrosoft Learn reference -
-ErrorAction(System.Management ) #.Automation .Action Preference Choose how this command responds to non-terminating errors.
Aliases:eaMicrosoft Learn reference -
-WarningAction(System.Management ) #.Automation .Action Preference Choose how this command responds to warning messages.
Aliases:waMicrosoft Learn reference -
-InformationAction(System.Management ) #.Automation .Action Preference Choose how this command handles information messages.
Aliases:infaMicrosoft Learn reference -
-ProgressAction(System.Management ) #.Automation .Action Preference Choose how this command handles progress updates.
Aliases:progaMicrosoft Learn reference -
-ErrorVariable(System.String ) #Store the command's error records in the named variable.
Aliases:evMicrosoft Learn reference -
-WarningVariable(System.String ) #Store the command's warning records in the named variable.
Aliases:wvMicrosoft Learn reference -
-InformationVariable(System.String ) #Store the command's information records in the named variable.
Aliases:ivMicrosoft Learn reference -
-OutVariable(System.String ) #Save output in the named variable while passing it down the pipeline.
Aliases:ovMicrosoft Learn reference -
Buffer output before passing it to the next pipeline command.
Aliases:obMicrosoft Learn reference -
-PipelineVariable(System.String ) #Make the most recent output object available through a named variable within the pipeline.
Aliases:pvMicrosoft Learn reference
-
- Returns
-
LibTmux.Workspace.WorkspaceResult:Onecompleted native result. Preview and declined confirmation emit nothing.
Discussed in Workspace guide
In other ports Build a session from a workspace description
- Julia
LibTmuxWorkspace.applyApplies a prepared
WorkspacePlanon an explicitServer, detached and under one deadline. Existing session names fail unless reuse is explicit. - Python
- Ruby
- Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript
- Rust
- Go
- Java
- C#
- C++
- Swift
- Kotlin No source-verified Kotlin equivalent is recorded for this operation.
- Scala No source-verified Scala equivalent is recorded for this operation.
- F# No source-verified F# equivalent is recorded for this operation.