Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux_erlang has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-erlang latest

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/2 limits. The file is read by tmux at execution time; this builder does not open it or bound its size.

parse_only requests native -n parsing without executing the configuration's command list. quiet requests native -q missing-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.
ok
2> tmux_command:argv(Source).
[<<"source-file">>,<<"-n">>,<<"--">>,<<"-">>]
Parameters

Guides#

Pages that discuss source_file/2.

In other ports#

Load a tmux configuration file

Equivalents of Load a tmux configuration file in other languages
Language Equivalent
Python libtmux.Server.source_file
Ruby LibTmux::Server#source_file
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript server.Server.sourceFile
Rust server.Server.source_file
Go tmux.Server.SourceFile
Java io.github.libtmux.Server.sourceFile
C# LibTmux.Server.SourceFileAsync
C++ libtmux::Server::source_file
Swift Server.sourceFile(_:)
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#.

Esc

Type to search.

Reference previewOpen reference