LibTmux.Workspace
- Anonymous module
-
Workspacedeclarations and automation overLibTmux. Alpha.Discussed in Workspace Manager , LibTmux.Workspace API reference · Workspace guide
Members
-
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.
- Convert
To-Tmux [-Workspace] <LibTmux.Workspace.WorkspaceFile> [<CommonWorkspace Json Parameters >] -
Convert a native workspace declaration to JSON text.
Description#
Return one string for each native WorkspaceFile received from the pipeline. The text uses the snake_case keys accepted by
Import-TmuxWorkspaceand the native parser. Conversion preserves pane and command order, empty strings, nullable fields, global and local options, post-construction options, environment and commands at every declaration level. It does not expand command text or inherit local defaults into children.Resolved directories and option values contain literal text. Conversion escapes their dollar signs as
$$so export, import and a later explicitResolve-TmuxWorkspacekeep the same values. Unresolved variable expressions remain unchanged. DocumentDirectory is resolution provenance and is omitted from the text; provide an explicit base when resolving the imported declaration.The native parser checks emitted text, including its character limit. This is not application validation: incomplete declarations can still be converted. No tmux observation, command execution, file writing or plan serialization occurs. Formatting and comments from an imported source document are not part of the native declaration and are not reproduced.
Notes
Serialization errors terminate with
Tmux.WorkspaceJsonFailedand retain the original exception. Null host commands are omitted because the native parser rejects an explicit null before_script. Nullable name and directory values remain distinct from empty strings. The native model does not retain a distinction between omitted and empty collections or omitted and false focus.Command details#
- Command type
cmdlet- Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Workspace.WorkspaceFile: A parsed or explicitly resolved declaration.- Outputs
-
System.String
Examples#
Example 1 Convert a two-pane declaration for storage or inspection. View source
Terminal window LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'session_name: developmentwindows:- window_name: workpanes: [nvim, ""]'@ | LibTmux.Workspace\ConvertTo-TmuxWorkspaceJson- Parameters
-
-
-Workspace(LibTmux.Workspace.WorkspaceFile) #The native declaration to serialize without applying it.
- 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
-
System.String:OneJSON document per input declaration.
Discussed in Workspace guide
- Convert
To-Tmux [-Workspace] <LibTmux.Workspace.WorkspaceFile> [<CommonWorkspace Yaml Parameters >] -
Convert a native workspace declaration to YAML text.
Description#
Return one string for each native WorkspaceFile received from the pipeline. The text uses the snake_case keys accepted by
Import-TmuxWorkspaceand the native parser. Conversion preserves pane and command order, empty strings, nullable fields, global and local options, post-construction options, environment and commands at every declaration level. It does not expand command text or inherit local defaults into children.Resolved directories and option values contain literal text. Conversion escapes their dollar signs as
$$so export, import and a later explicitResolve-TmuxWorkspacekeep the same values. Unresolved variable expressions remain unchanged. DocumentDirectory is resolution provenance and is omitted from the text; provide an explicit base when resolving the imported declaration.The native parser checks emitted text, including its character limit. This is not application validation: incomplete declarations can still be converted. No tmux observation, command execution, file writing or plan serialization occurs. Formatting and comments from an imported source document are not part of the native declaration and are not reproduced.
Notes
Serialization errors terminate with
Tmux.WorkspaceYamlFailedand retain the original exception. Null host commands are omitted because the native parser rejects an explicit null before_script. Nullable name and directory values remain distinct from empty strings. The native model does not retain a distinction between omitted and empty collections or omitted and false focus.Command details#
- Command type
cmdlet- Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Workspace.WorkspaceFile: A parsed or explicitly resolved declaration.- Outputs
-
System.String
Examples#
Example 1 Convert a two-pane declaration for storage or inspection. View source
Terminal window LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'session_name: developmentwindows:- window_name: workpanes: [nvim, ""]'@ | LibTmux.Workspace\ConvertTo-TmuxWorkspaceYaml- Parameters
-
-
-Workspace(LibTmux.Workspace.WorkspaceFile) #The native declaration to serialize without applying it.
- 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
-
System.String:OneYAML document per input declaration.
- Directory: Get-Tmux
Workspace -Directory <System.String > [<CommonParameters >] Discover (default): Get-TmuxWorkspace [-ConfigurationDirectory <System.String >] [-AllLocations ] [<CommonParameters >] LiteralPath: Get-TmuxWorkspace -LiteralPath <System.String > [<CommonParameters >] Name: Get-TmuxWorkspace [-Name] <System.String > [-ConfigurationDirectory <System.String >] [-AllLocations ] [<CommonParameters >] Search: Get-TmuxWorkspace [-ConfigurationDirectory <System.String >] [-AllLocations ] -Search <System.String > [-SearchIn <System.String []>] [-CaseSensitive ] [<CommonParameters >] -
Find workspace declaration files without loading sessions.
Description#
Return native
FileInfoobjects for readable, seekable declaration files. Discovery does not contact tmux, run scripts, resolve declaration variables or create configuration directories. Pipe a selected file toImport-TmuxWorkspacefor parsing, orResolve-TmuxWorkspacefor explicit file-relative resolution.With no arguments, list .tmuxp.yaml, .tmuxp.yml and .tmuxp.json in the current filesystem directory, then each ancestor through HOME when it is an ancestor, otherwise through the filesystem root. Each directory uses that extension order. Append files from the first existing global configuration directory: ConfigurationDirectory, TMUXP_CONFIGDIR, XDG_CONFIG_HOME/tmuxp (or HOME/.config/tmuxp), then HOME/.tmuxp. HOME falls back to the platform user profile directory when unset. Missing default locations are skipped; an explicit missing ConfigurationDirectory is an error. AllLocations includes all existing global candidates in that order, preserving shadowed files. Global filenames sort ordinally within each location. Repeated full paths are emitted once.
Directory checks only the three local .tmuxp filenames in that exact directory. LiteralPath selects one exact filesystem file and bypasses discovery; it has no extension restriction. File symlinks retain their literal paths when the shared opener accepts the target. Directory entries are not files and are never recursively descended, including directory symlinks.
Name searches only the selected global locations. It is a literal basename, with an optional .yaml, .yml or .json suffix. Without a supported suffix, those three suffixes are tried in order. Multiple matches in one location are an ambiguity error naming the candidates; use LiteralPath to choose. A missing name emits no objects. Path separators are rejected; wildcard characters are literal. Filename suffixes are lowercase and literal; path/name identity follows the filesystem, independently of search case behavior.
Searchuses literal ordinal-ignore-case substring matching on filenames by default. CaseSensitive selects ordinal matching. SearchIn selects FileName, Path,Session,Window, Command or Directory fields. Path searches the full selected path without reading file content. Any content field parses every candidate with the shared strict UTF-8 reader, accepting a UTF-8 BOM and at most 1048576 characters. Command includes before_script and all pane commands and shell_command_before entries; none are executed. Directory searches declared strings without expansion. Multiple fields combine by OR. Malformed candidate data fails content search even if its filename matches.Traversal stops with an error after 1024 examined entries: existing local marker probes and global directory entries count, including unselected suffixes and directories. Ancestor traversal also has a 1024-directory ceiling. Narrow the request with Directory, Name or LiteralPath. Results are published only after successful discovery/search, so failures do not emit truncated lists. Filesystem contents can change between discovery and later import;
FileInfooutput is not a locked or atomic filesystem snapshot.Notes
Failures write
Tmux.WorkspaceDiscoveryFailedwith the request as TargetObject. File read/parse errors retain the original exception and identify the failing path in Exception.Data['WorkspacePath']. UseErrorActionStop to terminate. Cancellation is checked between traversal, read and search operations and before publication. Stopping discovery does not delete files or stop a daemon.Command details#
- Command type
cmdlet- Default parameter set
- Discover
- Positional binding
- Enabled.
- Pipeline inputs
None: No pipeline input.- Outputs
-
System.IO.FileInfo
Examples#
Example 1 Select the existing declaration named by
$WorkspacePath, retaining a nativeFileInfothat can feedImport-TmuxWorkspaceorResolve-TmuxWorkspace. View sourceTerminal window LibTmux.Workspace\Get-TmuxWorkspace -LiteralPath $WorkspacePath- Parameters
-
-
-Directory(System.String ) (forDirectory) #Oneexisting directory whose local .tmuxp declaration filenames are checked.- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-ConfigurationDirectory(System.String ) (forDiscover;Name;Search) #The first global directory candidate. An explicitly supplied missing directory is an error.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-AllLocations(System.Management ) (for.Automation .Switch Parameter Discover;Name;Search) #Include every existing global location in precedence order instead of only the first.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Default
False
-
-LiteralPath(System.String ) (forLiteralPath) #Oneliteral FileSystem path. Other providers and directories are rejected.- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-Name(System.String ) (forName) #A literal global declaration basename, optionally ending in .yaml, .yml or .json.
- Required
- Yes
- Position
- 0
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-Search(System.String ) (forSearch) #Literal substring text, from 1 through 4096 characters. No regex or wildcard interpretation.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateLength(1, 4096)- Validation
ValidateNotNullOrEmpty()
-
-SearchIn(System.String []) (forSearch) #Fields to search. Any declaration field explicitly opts into bounded parsing of all candidates.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
FileName- Validation
ValidateNotNullOrEmpty()- Validation
ValidateCount(1, 6)- Validation
ValidateSet(["FileName","Path","Session","Window","Command","Directory"])
-
-CaseSensitive(System.Management ) (for.Automation .Switch Parameter Search) #Use ordinal case-sensitive substring matching. This does not change path or name identity.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- 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
-
System.IO.FileInfo: Declaration files in documented precedence order.
Discussed in Workspace guide
- Get-Tmux
Workspace [-Workspace] <LibTmux.Workspace.WorkspaceFile> -Server <LibPlan Tmux > [-Existing.Server Session <LibTmux.Workspace.WorkspaceExistingSession>] [-ServerStartup <LibTmux.Workspace.WorkspaceServerStartup>] [-Readiness <LibTmux.Workspace.WorkspaceReadiness>] [-ReadinessTimeout <System.Double >] [-CompensateOn ] [-AllowFailure Host ] [-HostScripts Script <SystemTimeout .Double >] [-MaxHost <SystemOutput Bytes .Int32 >] [-CleanupTimeout <System.Double >] [<CommonParameters >] -
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
Allnumeric timeout parameters use seconds. Policy validation occurs before endpoint observation. Planning errors preserve the native exception with theTmux.WorkspacePlanFailedidentifier; invalid policy values useTmux.InvalidWorkspacePolicy.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
Plana workspace at an explicit socket without creating its session. View sourceTerminal window $endpoint = LibTmux\New-TmuxServer -SocketPath $SocketPathLibTmux.Workspace\Import-TmuxWorkspace -Yaml @'session_name: developmentwindows:- window_name: editor'@ | LibTmux.Workspace\Get-TmuxWorkspacePlan -Server $endpoint- Parameters
-
-
-Workspace(LibTmux.Workspace.WorkspaceFile) #The immutable parsed declaration. Resolve paths explicitly before planning when they depend on a document directory.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
The explicit endpoint to inspect. Planning borrows its lifetime and never initializes an absent daemon.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNull()
-
-ExistingSession(LibTmux.Workspace.WorkspaceExistingSession) #Choose Error, Reuse, Append or Replace for a session with the same literal name. Replace is frozen into the plan; invocation uses normal PowerShell confirmation.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
Error- Validation
ValidateSet(["Error","Reuse","Append","Replace"])
-
-ServerStartup(LibTmux.Workspace.WorkspaceServerStartup) #CreateOrJoin allows later application to start or join an initially absent daemon. RequireExisting fails planning when no daemon is present. Neither choice grants daemon ownership.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
CreateOrJoin- Validation
ValidateSet(["CreateOrJoin","RequireExisting"])
-
-Readiness(LibTmux.Workspace.WorkspaceReadiness) #Immediate sends input without claiming shell readiness or command completion. Cooperative requires pane startup to signal the channel named by LIBTMUX_WORKSPACE_READY.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
Immediate- Validation
ValidateSet(["Immediate","Cooperative"])
-
-ReadinessTimeout(System.Double ) #Each cooperative signal budget in seconds. Accepts finite values from 0.0000001 through 86400.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
10
-
-CompensateOnFailure(System.Management ) #.Automation .Switch Parameter Attempt cleanup of journal-proven creations after failure. Shell input and host-script effects are irreversible. Owned readiness channels and replacement keepalives have mandatory cleanup regardless of this switch.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Default
False
-
-AllowHostScripts(System.Management ) #.Automation .Switch Parameter Allow a declared before_script to become a native RunHostScript action. Planning does not execute it. Reuse skips it when the existing session can be reused.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Default
False
-
-HostScriptTimeout(System.Double ) #The host script deadline, including output collection, in seconds. Accepts finite values from 0.0000001 through 86400.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
30
-
-MaxHostOutputBytes(System.Int32 ) #The positive combined stdout and stderr capture limit in UTF-8 bytes. Additional output is drained and its dropped byte count remains visible in the native host result.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
1048576
-
-CleanupTimeout(System.Double ) #The total failure-cleanup budget in seconds. Accepts finite values from 0.0000001 through 86400. Incomplete or uncertain cleanup remains visible in the native journal.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
1
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.WorkspacePlan: The native immutable plan with its endpoint and ordered actions.
Discussed in Workspace guide
- File: Import-Tmux
Workspace -File <System.IO > [<Common.File Info Parameters >] Path (default): Import-TmuxWorkspace [-LiteralPath ] <System.String > [<CommonParameters >] Yaml: Import-TmuxWorkspace -Yaml <System.String > [<CommonParameters >] -
Parse a workspace declaration without executing it.
Description#
Read a literal filesystem path, a
FileInfopipeline or supplied YAML/JSON text into a native WorkspaceFile.Inputsmust be seekable UTF-8 files; a UTF-8 BOM is accepted. Named pipes are rejected without waiting for a writer. Admission stops at 1048576 characters, before retaining an oversized document. Malformed YAML/JSON and invalid UTF-8 preserve their exceptions as InvalidData errors.Parsing does not start tmux, execute host scripts or expand paths and variables.
Resolve-TmuxWorkspacesupplies an explicit document base and allowed variables.Test-TmuxWorkspacechecks declaration completeness and execution policy.A window can set
window_indexto a nonnegative session-relative index. Omit it for tmux's next free index. Duplicate requested indexes fail validation; an index already occupied in the session fails during application.Notes
File errors retain
Tmux.InvalidWorkspaceand allow later pipeline files withErrorActionContinue.ErrorActionStop terminates. No form applies a workspace.Command details#
- Command type
cmdlet- Default parameter set
- Path
- Positional binding
- Enabled.
- Pipeline inputs
-
System.IO.FileInfo: A file to read and parse. - Outputs
LibTmux.Workspace.WorkspaceFile
Examples#
Example 1 Inspect a declaration with a window at index 5 without starting tmux. View source
Terminal window LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'session_name: developmentwindows:- window_name: editorwindow_index: 5panes: [null]'@- Parameters
-
-
-File(System.IO ) (for.File Info File) #A
FileInforeturned byGet-Itemor workspace discovery. Its path is literal.- Required
- Yes
- Position
- Named
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-LiteralPath(System.String ) (forPath) #The literal file path to read.
- Required
- Yes
- Position
- 0
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-Yaml(System.String ) (forYaml) #YAML or JSON declaration text.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
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: Native pipeline type for this command.
- Invoke-Tmux
Workspace [-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.
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.
- File: Resolve-Tmux
Workspace -File <System.IO > [-Variables <System.File Info .Collections >] [<Common.IDictionary Parameters >] Path: Resolve-TmuxWorkspace -LiteralPath <System.String > [-Variables <System.Collections >] [<Common.IDictionary Parameters >] Workspace (default): Resolve-TmuxWorkspace [-Workspace] <LibTmux.Workspace.WorkspaceFile> -BaseDirectory <System.String > [-Variables <System.Collections >] [<Common.IDictionary Parameters >] -
Resolve inherited workspace paths against an explicit document base.
Description#
Return a replacement native declaration with resolved inherited directories and option values. A parsed WorkspaceFile requires an explicit BaseDirectory. LiteralPath and File read a bounded, seekable UTF-8 YAML/JSON file and use its absolute parent as the base. Paths use the FileSystem provider without wildcard expansion. Malformed declarations and invalid UTF-8 retain their native exceptions as InvalidData errors.
Expansion uses only the supplied case-sensitive string map. Supply HOME for home-directory expansion in paths; no process environment is copied implicitly. Dollar pairs represent a literal dollar sign in declaration paths and option values.
Session, window and pane option values expand supplied variables; unknown variables in option values remain literal. Unresolved path variables are errors. Option names, command text, the host script, session and window names, and environment values remain literal. Resolution does not execute scripts, inspect tmux or require the resulting directories to exist. The input declaration remains unchanged.Notes
Invalid variable maps terminate with
Tmux.InvalidWorkspaceVariablesbefore processing input. File and resolution failures retain their native exception underTmux.WorkspaceResolutionFailed;ErrorActionContinue permits later input.Command details#
- Command type
cmdlet- Default parameter set
-
Workspace - Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Workspace.WorkspaceFile: A declaration used with BaseDirectory.;System.IO.FileInfo: A declaration file to read and resolve.- Outputs
LibTmux.Workspace.WorkspaceFile
Examples#
Example 1 Resolve a parsed declaration against the current filesystem directory. Pass a different explicit BaseDirectory when the declaration came from elsewhere. View source
Terminal window $resolve = @{BaseDirectory = (Get-Location).PathVariables = @{ PROJECT = 'src' }}LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'session_name: developmentstart_directory: "${PROJECT}"windows:- panes: [null]'@ | LibTmux.Workspace\Resolve-TmuxWorkspace @resolve- Parameters
-
-
-File(System.IO ) (for.File Info File) #A
FileInfowhose parent becomes the document base.- Required
- Yes
- Position
- Named
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Variables(System.Collections ) #.IDictionary Allowed string expansion variables. Values requiring conversion are rejected.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNull()
-
-LiteralPath(System.String ) (forPath) #The literal declaration path. The file parent becomes its document base.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-Workspace(LibTmux.Workspace.WorkspaceFile) (forWorkspace) #The parsed declaration to resolve without reading a file.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-BaseDirectory(System.String ) (forWorkspace) #The explicit filesystem base for a parsed declaration. Relative bases resolve against the current PowerShell location.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
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: The replacement declaration with document-directory provenance.
- Test-Tmux
Workspace [-Workspace] <LibTmux.Workspace.WorkspaceFile> [-ExistingSession <LibTmux.Workspace.WorkspaceExistingSession>] [-ServerStartup <LibTmux.Workspace.WorkspaceServerStartup>] [-Readiness <LibTmux.Workspace.WorkspaceReadiness>] [-ReadinessTimeout <System.Double >] [-CompensateOn ] [-AllowFailure Host ] [-HostScripts Script <SystemTimeout .Double >] [-MaxHost <SystemOutput Bytes .Int32 >] [-CleanupTimeout <System.Double >] [<CommonParameters >] -
Validate a workspace declaration and its intended policies locally.
Description#
Apply the shared .NET declaration and policy checks to a native WorkspaceFile. Validation reads no tmux state and executes no commands or scripts. Importing a workspace checks syntax; this command additionally rejects incomplete or invalid declarations under the supplied policy.
Validation returns True on success. An invalid declaration writes its native error and returns False;
ErrorActionStop terminates instead. Invalid policy parameters terminate before processing input.Local validation does not check endpoint conflicts, paths on disk, shell syntax or tmux option support. Reuse defers host-script admission until planning knows whether creation is needed. Use
Get-TmuxWorkspacePlanfor endpoint observation and a reviewable plan; the validation result is not permission to apply it.Notes
Tmux.WorkspaceValidationFailedretains the native exception and declaration.Tmux.InvalidWorkspacePolicyidentifies invalid policy parameters.Command details#
- Command type
cmdlet- Positional binding
- Enabled.
- Pipeline inputs
LibTmux.Workspace.WorkspaceFile: A parsed or programmatically constructed declaration.- Outputs
-
System.Boolean
Examples#
Example 1 Check a one-window declaration without opening a tmux connection. View source
Terminal window LibTmux.Workspace\Import-TmuxWorkspace -Yaml @'session_name: developmentwindows:- panes: [null]'@ | LibTmux.Workspace\Test-TmuxWorkspace- Parameters
-
-
-Workspace(LibTmux.Workspace.WorkspaceFile) #The immutable declaration to check.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-ExistingSession(LibTmux.Workspace.WorkspaceExistingSession) #Reuse defers host-script admission until planning determines whether creation is necessary.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
Error- Validation
ValidateSet(["Error","Reuse","Append","Replace"])
-
-ServerStartup(LibTmux.Workspace.WorkspaceServerStartup) #The startup policy intended for planning; validation does not inspect the endpoint.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
CreateOrJoin- Validation
ValidateSet(["CreateOrJoin","RequireExisting"])
-
-Readiness(LibTmux.Workspace.WorkspaceReadiness) #The declared startup contract; validation does not wait for or prove shell readiness.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
Immediate- Validation
ValidateSet(["Immediate","Cooperative"])
-
-ReadinessTimeout(System.Double ) #A finite positive readiness budget in seconds, at most 86400.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
10
-
-CompensateOnFailure(System.Management ) #.Automation .Switch Parameter Validate the policy that permits compensation of journal-owned creations after application failure.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Default
False
-
-AllowHostScripts(System.Management ) #.Automation .Switch Parameter Admit declared host scripts for planning. Validation never executes them.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Default
False
-
-HostScriptTimeout(System.Double ) #A finite positive host-script budget in seconds, at most 86400.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
30
-
-MaxHostOutputBytes(System.Int32 ) #A positive combined stdout and stderr capture limit in UTF-8 bytes.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
1048576
-
-CleanupTimeout(System.Double ) #A finite positive application cleanup budget in seconds, at most 86400.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
1
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
-
System.Boolean: True for a valid declaration; False after a nonterminating validation error.
Discussed in Workspace guide