Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux_erlang has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-erlang latest

tmux_command:to_config/1

Render validated commands as native configuration text, without I/O. Accepts one command, a sequence/1 value, or a nonempty flat list of at most 256 commands. Returns an ASCII binary of at most 32 KiB, without a final newline. Validation uses validate/1; escaping growth, command count and aggregate size can return command_limit. Lists use native command separators between independently quoted commands. Rendering does not execute them or provide atomic execution or rollback. The text carries no origin token; executing serialized configuration requires the caller to choose and validate its destination explicitly.

Source and package
Qualified name
tmux_command:to_config/1
Declared in
tmux_command
Package
libtmux_erlang
Source
apps/libtmux_erlang/src/tmux_command.erl
to_config/1 -spec to_config(t() | [t(), ...]) -> {ok, binary()} | {error, map()}.

Description#

Each argument is doublequoted. Quote, backslash, dollar, tilde, control and non-ASCII bytes use three-digit octal escapes. Empty arguments, semicolons, newlines and non-UTF-8 byte values remain argument data. The lexer does not expand their variables or tilde prefixes, strip newline indentation, or interpret them as directives, comments or additional commands.

Protection covers one lexer pass. Native command-string arguments, including bind-key and set-hook values, can be parsed again by the receiving command. Render each inner command string separately for its own parse boundary.

This is tmux configuration syntax, separate from argv/1 executable arguments and shell quoting. Native commands still interpret their values and expand formats as usual; literal_format/2 handles that separate boundary when literal format values are required. Load the text explicitly with source_file/2, or store it through a native command that accepts configuration text. The configuration guide uses this renderer with explicit execution and completion signals.

Parameters

Guides#

Pages that discuss to_config/1.

Esc

Type to search.

Reference previewOpen reference