Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

io.github.libtmux.TmuxFormats.TmuxFormats

Java
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
io.github.libtmux.TmuxFormats
Package
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/TmuxFormats.java
class io.github.libtmux.TmuxFormats.TmuxFormats
classreadonly [source]
classreadonly [source]
class io.github.libtmux.TmuxFormats.TmuxFormats

Values handed to a tmux argument position that expands formats.

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

It cannot do that for an argument the caller composes: Pane#pipeTo , Window#displayPopup , Server#runShell , Server#runShellCapturing and Server#ifShell all take a whole shell command, where format expansion is a documented tmux feature a caller may want — #{pane_id} in a filename, for instance. A caller interpolating an untrusted value into one of those needs #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 #(...) inside single quotes still runs. Measured on tmux 3.7d, with the interpolated value quoted as a careful caller would quote it: run-shell executed it, and pipe-pane -O executed it as soon as the pane produced output.

1 declared, 0 inherited

Members

  • literal method Makes one caller value literal at one construction boundary.
Esc

Type to search.