# tmux_command:literal_format/2

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_command.erl#L407
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_command-literal_format-2/

```
literal_format/2
-spec literal_format(binary(), tmux | time) ->
                        {ok, binary()} | {error, map()}.
```

Quote a complete literal format argument. Mode tmux protects hash expansion; mode time also protects strftime percent directives. Stored-name semantics remain tmux's own. This handles one expansion pass, not a nested operand, recursive expansion or later visual style rendering. Performs no I/O.

Hash runs before `[` stay unchanged because tmux preserves style-looking
prefixes for a separate drawing step. Other hashes are doubled. In time mode,
an argument containing percent bytes must fit tmux's 8191-byte strftime result
limit after hash encoding and before percent doubling; larger values return
`format_limit` with `time_bytes` and `max_bytes`. Arguments without percent
bytes skip that native time-expansion limit. The encoded 32 KiB command limit
still applies in either mode.

## Parameters

- `Value` (`binary()`)
- `Mode` (`tmux | time`)

## Guides

Pages that discuss `literal_format/2`.

- [Pipe pane output](/en/erlang/latest/guides/piping/)
