LibTmux.Workspace\Invoke-TmuxWorkspace
- Invoke-TmuxWorkspace [-Plan] <Lib
Tmux > [-What.Workspace .Workspace Plan If ] [-Confirm] [<CommonParameters >] -
Apply the exact workspace plan after one confirmation.
Description
Apply the supplied native
WorkspacePlanusing 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 noWorkspaceResult.Successful invocation returns one native
WorkspaceResultcontaining the session, created windows, unsupported layouts and action journals.WorkspaceBuildExceptionremains ErrorRecord.Exception under Tmux.WorkspaceApplyFailed, with the original plan as TargetObject. Inspect itsDispatch,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. A window name with a colon or a period on exactly tmux 3.7 reports
LibTmux.TmuxUnsupportedOnReleaseExceptionbefore the first action creates anything.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
- Parameters
-
-
-Plan(LibTmux ).Workspace .Workspace Plan 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 -
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.
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
Guides
task materialPages that discuss Invoke-TmuxWorkspace.
In other ports
task equivalence 13 other ports mappedSource-verified mappings for Build a session from a workspace description. A mapping says these APIs perform the same task. It does not say they share defaults, errors or completion: check each page.
| Port | API | Differs from PowerShell |
|---|---|---|
| PowerShell | Lib Apply the exact workspace plan after one confirmation. | This page |
| Python | tmuxp Build tmux workspace in session. | None recorded in the model |
| Ruby | Lib Behavior: Workspace apply. | None recorded in the model |
| Julia | Lib | Applies a prepared WorkspacePlan on an explicit Server, detached and under one deadline. Existing session names fail unless reuse is explicit. |
| Common Lisp | libtmux Apply WORKSPACE through explicit CLIENT and return a WORKSPACE-RESULT.
Workspace/1 retains topology-only creation/reuse. Workspace/2 freshly acquires
owned state and replans; a preview is never mutation authority. By default
owned declaration changes or drift are refused; :RECONCILE permits only the
qualified additive, rename, metadata and layout changes. It never adopts an
unowned session or repeats an uncertain mutation. RECONCILE requires schema /2. | None recorded in the model |
| TypeScript | builder Build a workspace into a real tmux session, or reconcile one that exists. | async |
| Rust | src Create the session a workspace describes, and return it. | async |
| Go | workspace Build creates the workspace on server and returns the created session. | None recorded in the model |
| Java | io Creates the described session on a server. | None recorded in the model |
| C# | Lib Plans and applies a workspace with the default policies. | async |
| C++ | libtmux:: | None recorded in the model |
| Swift | Workspace Creates the workspace's session and returns it. | async |
| OCaml | Libtmux Apply steps at most once per execution handle. Expected failures return retained receipts. On initial application, compensate_on_failure defaults to true, attempting removal of proven newly created panes after failure or cancellation. Passing false skips that compensation. Cancellation propagates after recording progress and at most 500 ms of protected compensation; use inspect afterward. | Apply a validated Plan through submit, then await its retained execution receipt. Inspect preserves partial and late outcomes. |
| Perl | Lib load(server => $server, existing => 'error'|'skip') uses public LibTmux::Server operations. It checks all session-name conflicts before creation. error rejects any existing target with Conflict; skip leaves that entire session alone, so repeated application creates only absent sessions. A missing server permits explicit creation; other acquisition failures propagate. | Loads through installed public core APIs; existing-target policy and known owned rollback effects are explicit. |
No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
Workspace functionality is outside the Raku core library scope.
No equivalent is recorded in Lua, Erlang, Elixir, Clojure, Kotlin, Scala or F#.