tmux_command:source_file/2
Build configuration loading from stdin or one literal absolute path, without I/O. stdin renders source-file -; supply configuration bytes in the stdin option of tmux_server:command/3 or tmux_operation:start/3. Those APIs bound input to 256 KiB including their argument reservation.
Source and package
- Qualified name
-
tmux_command: source _file/2 - Declared in
tmux_command- Package
- libtmux_erlang
- Source
- apps/libtmux_erlang/src/tmux_command.erl
- Other languages
- Perl PowerShell Julia Elixir Haskell Common Lisp PythonRuby Lua TypeScriptRustGoJavaC#C++Swift Kotlin Scala OCaml F# Clojure
- source_file(Source, Options) -spec source_file(source(), source
_options ()) -> {ok, t()} | {error, map()}. -
Description#
Paths are NUL-free POSIX byte binaries. Glob metacharacters and backslashes are escaped so only that filename is selected; format expansion is disabled. The combined encoded path and flags must fit
raw/2limits. The file is read by tmux at execution time; this builder does not open it or bound its size.parse_onlyrequests native-nparsing without executing the configuration's command list.quietrequests native-qmissing-file suppression; it does not suppress syntax or execution errors. Both default to false. Configuration is trusted tmux code, with its own variable, directive and command semantics. Parse-only is not a sandbox. Execution can partially change server state before an error; cancellation cannot undo those effects. Completion does not prove that background jobs launched by the configuration have finished.Examples#
1> {ok, Source} = tmux_command:source_file(stdin, #{parse_only => true}), ok.ok2> tmux_command:argv(Source).[<<"source-file">>,<<"-n">>,<<"--">>,<<"-">>]
Guides#
Pages that discuss source_file/2.
In other ports#
Load a tmux configuration file
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | server |
| Rust | server |
| Go | tmux |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |
No equivalent is recorded in Lua, PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.