# LibTmux.Format.field/1

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/format.ex#L26
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-format-field-1/

```
field(name)
@spec field(String.t()) :: binary()
```

Encodes one named field for `LibTmux.Codec.decode_field/3` with `encoding: :escaped_v1`.

Backslashes are replaced first, then dollars and ASCII control bytes.
This protects values from tmux 3.4's ambiguous print escaping. The `v1:`
prefix and encoded newlines prevent field text from becoming reply guards.
This encodes one field. Capture composes these fields inside its versioned
row framing; this is not an arbitrary format wrapper. The caller must still
bound the response and validate the
field against its schema and the connected server's capabilities.

See the [worked example](api-examples.html#encoding-and-protocol).

## Parameters

- `name` (`String.t()`)
