Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Workspace

API reference · Markdown

struct Workspace : struct Workspace
struct [source]
struct [source]
struct Workspace

A tmux layout described as data, in tmuxp's vocabulary.

The modelled keys use tmuxp's spelling, so files limited to this structural subset need no translation. tmuxp's plugins, hooks, and environment runtime are ignored.

Discussed in Swift workspace internals , Swift workspace builder behavior , Swift workspace builder API

In other ports Describe a workspace as data

Members

!=(_:_:)

!=(_:_:) ( lhs : Self , rhs : Self ) → Bool
functionstatic
functionstatic
!=(_:_:)

Inherited from Equatable.!=(_:_:)

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.

This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.

  • Parameters:
    • lhs: A value to compare.
    • rhs: Another value to compare.

sessionName

sessionName : let sessionName: String
property [source]
property [source]
sessionName

What the session is called once built.

startDirectory

startDirectory : let startDirectory: String?
property [source]
property [source]
startDirectory

Where every window starts unless it names its own. Left out, tmux uses whatever directory it was started from.

windows

windows : let windows: [WindowPlan]
property [source]
property [source]
windows

The windows to build, in the order they are written.

init(sessionName:startDirectory:windows:)

init(sessionName:startDirectory:windows:) ( sessionName : String , startDirectory : String? , windows : [WindowPlan] )
method [source]
method [source]
init(sessionName:startDirectory:windows:)

decode(json:)

decode(json:) ( json : Data ) → Workspace
methodstatic [source]
methodstatic [source]
decode(json:)

Reads a workspace from JSON.

Raises

Discussed in Build a workspace from a file · Use the Swift workspace builder , Swift workspace builder API

decode(yaml:)

decode(yaml:) ( yaml : String ) → Workspace
methodstatic [source]
methodstatic [source]
decode(yaml:)

Reads a workspace from YAML, which is how tmuxp files are usually written.

Available when the YAMLWorkspaces trait is enabled, which is what pulls in the YAML parser:

Examples

.package(
url: "https://github.com/libtmux/libtmux-swift.git",
exact: "0.1.0-alpha.5",
traits: ["YAMLWorkspaces"]
)
Raises

Discussed in Build a workspace from a file · Use the Swift workspace builder , Swift workspace builder API

init(from:)

init(from:) ( from : any Decoder )
method
method
init(from:)

Inherited from Decodable.init(from:)

Creates a new instance by decoding from the given decoder.

This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

  • Parameter decoder: The decoder to read data from.
Esc

Type to search.