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
- Module
- io.github.libtmux.TmuxFormats
- Package
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/TmuxFormats.java
-
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#literalat 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#runShellCapturingandServer#ifShellall 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#literalon 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-shellexecuted it, andpipe-pane -Oexecuted it as soon as the pane produced output.
1 declared, 0 inherited
Members
- literal method Makes one caller value literal at one construction boundary.