Core LibraryalphaAPI 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.

function libtmux-cxx latest

format_request

Build the format argument for one entity's fields, terminating every field so a trailing empty value is still a value rather than a missing column.

Source and package
Qualified name
libtmux::format_request
Namespace
libtmux
Package
libtmux-cxx
Source
include/libtmux/snapshot.hpp
[[C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.Language documentation]] std::string format_request(std::span<const std::string_view> fields);

Description#

The two substitutions nest rather than run in sequence, because tmux applies the inner one to the raw value and the outer one to its result. In that order a value already holding the escape marker is neutralised before the separator pass can produce one; reversed, the two become indistinguishable.

#{s/…/…/:…} predates every tmux this library supports, and neither character is a regular-expression metacharacter.

Unconditional, rather than applied only to the fields that could carry a separator. Expanding the substitutions costs about 0.32us per row — a 61-row listing pays 19us, against a process launch of some milliseconds — and a per-field exemption list is a thing to get wrong later, once, silently.

Parameters
Esc

Type to search.

Reference previewOpen reference