Core Library0.xAPI Reference

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.

Swift API

method libtmux-swift latest

Server.format(_:for:)

Evaluates a tmux format and hands back what it printed.

Source and package
Qualified name
Server.format(_:for:)
Declared in
Server
Package
libtmux-swift
Source
Sources/LibTmux/Formats.swift

Description#

The listed types carry the fields worth modelling — a Pane knows its id, its size, and what is running in it. tmux publishes hundreds more, and this reaches any of them without the library having to name each one first:

Ask for as many fields as you like in one template, separated by whatever the value cannot contain — a newline is the one separator to avoid, since a connection reads commands by line and refuses one.

  • Returns: what tmux printed, minus the newline it ends every answer with, or nil when target no longer resolves.

Examples#

let tty = try await server.format("#{pane_tty}", for: pane, through: link)
Parameters
Raises

tmux command#

The tmux commands behind format(_:for:).

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference