LibTmux.Workspace\Get-TmuxWorkspace
- Directory: Get-TmuxWorkspace -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