# io.github.libtmux.TmuxFormats.TmuxFormats

- **Module:** io.github.libtmux.TmuxFormats
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/TmuxFormats.java#L25
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-tmuxformats-tmuxformats/

Values handed to a tmux argument position that expands formats.

tmux expands {@code #{...}} and {@code #(...)} in many argument positions, and {@code #(...)}
runs a shell command. For the arguments this library composes itself — a window name, a pane
title, a working directory — it applies {@link #literal} at the construction boundary, so a
caller's {@code #} stays a {@code #}.

It cannot do that for an argument the caller composes: {@link Pane#pipeTo},
{@link Window#displayPopup}, {@link Server#runShell}, {@link Server#runShellCapturing} and
{@link Server#ifShell} all take a whole shell command, where format expansion is a documented
tmux feature a caller may want — {@code #{pane_id}} in a filename, for instance. A caller
interpolating an untrusted value into one of those needs {@link #literal} on that value, which is
why this is public.

Shell quoting does not substitute for it. tmux expands the format *before* the shell
sees the string, so a {@code #(...)} inside single quotes still runs. Measured on tmux 3.7d, with
the interpolated value quoted as a careful caller would quote it: {@code run-shell} executed it,
and {@code pipe-pane -O} executed it as soon as the pane produced output.

## Members

- `literal` (method): Makes one caller value literal at one construction boundary.
