LibTmux.Workspace\ConvertTo-TmuxWorkspace
- ConvertTo-TmuxWorkspace [-Session] <Lib
Tmux > [<Common.Session Parameters >] -
Convert a captured session to a native workspace declaration.
Description#
Return one native WorkspaceFile for each captured
Sessionreceived from the pipeline. The shared library preserves captured window placements and pane order, names, layouts, active window and pane flags, and pane directories. Repeated links to the same window become separate declared windows.Capture with
Get-TmuxSnapshot-DepthPanes before selecting aSession. Conversion never contacts tmux or fills unavailable relations. The captured graph remains convertible after its daemon exits. A missing field or relation is an error; a captured null pane directory remains unspecified rather than using the host's current directory.Captured directories become unresolved declaration values with literal dollars escaped as
$$. DocumentDirectory remains null. UseResolve-TmuxWorkspacewith an explicit BaseDirectory before planning, or convert the declaration to YAML or JSON and resolve it after importing. Do not interpret those escaped values as already resolved filesystem paths.Conversion preserves session-relative window indices. It emits a warning for each successful input because it omits observed environment, options, terminal text, entity IDs, pane indices and shared-link identity. It cannot reconstruct original commands, arguments or shell intent. Foreground command names do not establish the shell command that started a pane. Original relative paths, expansion variables, comments, host scripts and pre-commands are not reconstructed. Native custom layouts can change which pane occupies a position when applied. This declaration is a starting configuration, not a checkpoint of running programs.
Notes
Tmux.WorkspaceFreezeFailedretains the original native exception and inputSessionas its target.IncompleteSnapshotExceptionuses the InvalidData error category.ErrorActionContinue permits later sessions to be converted without emitting a declaration for a failed input;ErrorActionStop terminates. The loss warning uses PowerShell's warning stream and supportsWarningAction. The command performs no acquisition, execution or file write and has no WhatIf or Confirm parameters.Command details#
- Command type
cmdlet- Positional binding
- Enabled.
- Pipeline inputs
-
LibTmux.Session: A native captured session; serialized copies are not live native objects. - Outputs
LibTmux.Workspace.WorkspaceFile
Examples#
Example 1 Convert a native
Sessionselected from a pane-depth snapshot. This operation uses only the supplied capture and does not own resources requiring cleanup. View sourceTerminal window $capturedSession | LibTmux.Workspace\ConvertTo-TmuxWorkspace- Parameters
-
-
The native session whose window, pane and active-pane relations and required fields have already been captured. Binding by an arbitrary object's
Sessionproperty is not supported.- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
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.WorkspaceFile:Oneunresolved declaration per successfully converted input session.