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

Swift API

Swift documentation

Server.format(_:for:)

Swift
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift

View as Markdown

Declared in
Server
Package
libtmux-swift
Source
Sources/LibTmux/Formats.swift
format(_:for:) ( template : String , for : Session ) → String? ( template : String , for : WindowLink ) → String?
methodasyncoverload2 overloads [source]
methodasyncoverload2 overloads [source]
format(_:for:)

Evaluates a tmux format and hands back what it printed.

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)
Raises

0 declared, 0 inherited

Esc

Type to search.