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.]] std::string format_request(std::span <const std::string > fields);_view -
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
-
-
fields(std::span <const std::string >) #_view
-