Core LibraryalphaTopics

Choose documentation 3

latest

Current version

latest
English

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

Edit this page on GitHub

Architecture

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

Type to search.

Reference preview Open reference