Documentation
¶
Overview ¶
Package tmuxformat builds and decodes multi-field tmux format output.
Index ¶
Constants ¶
const Separator = "|"
Separator is printable because tmux versions disagree about how C0 bytes in formatted output are represented. Fields() q-escapes this byte in values.
Variables ¶
This section is empty.
Functions ¶
func ClientArgs ¶ added in v1.15.0
ClientArgs returns arguments for a tmux client whose output must preserve UTF-8 exactly. Without -u, tmux started from a locale-free SSH command can replace both non-ASCII bytes and C0 separators in formatted output, turning a valid machine response into an ambiguous one.
func Fields ¶
Fields returns one tmux format expression whose values can be decoded with Split. The q modifier escapes separators, whitespace, backslashes, and control bytes without changing the number of output fields.
func RecordFields ¶ added in v1.16.0
RecordFields produces one printable record, including when values contain literal line breaks or control bytes. Quote before substituting so literal backslash-octal text remains distinct from an encoded byte. Dollars also need octal encoding: older tmux output adds a backslash to them after formatting. The format itself contains C0 regex bytes; control-mode callers must quote those bytes with tmux command-parser escapes rather than strip them.
Types ¶
This section is empty.