Workspace ManagerconceptAPI reference

Choose documentation 2

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

Concept example A working example of the core library. It can change without notice. What concept means

LibTmux.Workspace\Import-TmuxWorkspace

File: Import-TmuxWorkspace -File <System.IO.FileInfo> [<CommonParameters>]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 FileInfo pipeline or supplied YAML/JSON text into a native WorkspaceFile. Inputs must 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-TmuxWorkspace supplies an explicit document base and allowed variables. Test-TmuxWorkspace checks declaration completeness and execution policy.

A window can set window_index to 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.InvalidWorkspace and allow later pipeline files with ErrorAction Continue. ErrorAction Stop 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
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.Workspace.WorkspaceFile: Native pipeline type for this command.

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: development
windows:
- window_name: editor
window_index: 5
panes: [null]
'@
Esc
Search in

Type to search.

Reference previewOpen reference