Core Library0.xTopics

Choose documentation 3

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
Edit this page on GitHub

Architecture

Needs libtmux for Swift 0.x Install

A server handle selects a tmux server. Object IDs select sessions, windows, and panes within it. For the object hierarchy and stable IDs, start with Server, session, window, pane.

Calling operations

Swift’s Session, Window, and Pane are Sendable value types holding IDs and state fields. Format-token fields lists their fields. Perform operations through Server, passing the target value:

try await server.sendKeys(["echo hi", "Enter"], to: pane)
try await server.kill(pane)

Keep the Server that produced the snapshot. Pass its captured values back to that server for operations.

Reading tmux fields

Object IDs become tmux targets (-t). Format variables (#{...}) provide the state returned by tmux.

Snapshots capture a fixed set of non-optional fields, including indices, dimensions, active state, command, path, and edge flags. Format-token fields covers other tokens.

Source layout

Sources/LibTmux/Server.swift defines Server. Sources/LibTmux/Session.swift, Sources/LibTmux/Window.swift, and Sources/LibTmux/Pane.swift define the snapshot value types. Sources/LibTmux/Snapshot.swift implements the relationship queries.

Extensions on Server group related operations: Sources/LibTmux/Options.swift implements options and hooks, Sources/LibTmux/PaneInteraction.swift handles input and capture, and Sources/LibTmux/Mutations.swift handles changes such as killing a pane.

Esc
Search in

Type to search.

Reference previewOpen reference