Server.start/1
Starts a private tmux server and returns a Server for it.
Source and package
- Qualified name
-
LibTmux .Server. start/1 - Module
- LibTmux
- Declared in
Server- Package
- libtmux
- Source
- lib/libtmux/server.ex
- start(options) @spec start([start
_option ()]) :: {:ok, t()} | {:error, LibTmux ()}.Error .t -
Description
The server runs in the foreground under libtmux's native helper, in a directory of its own below
:root: the directory has mode 700, holds the socket and isTMUX_TMPDIRfor the daemon and its panes. The daemon never inheritsTMUXorTMUX_PANE, reads:config_file(an empty file by default), and stays up with no session.start/1returns when the socket answers, or when:timeout(5000 ms by default) ends.The process that calls
start/1owns the server. When it exits, the daemon stops and its directory is removed. If the VM is killed, the native helper still retires the daemon, but the directory stays. Other processes may use the returned Server. Stop it withstop/2as soon as the work is done, or usewith_owned/2.Returns
{:error, error}for an invalid option, a socket path that would exceed the 107 usable bytes ofsun_path, a daemon that cannot start or exits before it answers, and a timeout. A failed start leaves no directory behind. It starts only on Linux, like the rest of libtmux.alias LibTmux.Server
{:ok, server} = Server.start(executable: System.find_executable("tmux")) {:ok, _} = Server.new_session(server, "demo", command: {:argv, ["/bin/cat"]}) :ok = Server.stop(server)
- Parameters
-
-
options([start_option ()])
-
Recorded calls
source callsThe Elixir reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux.Server.start/1.
Guides
task materialPages that discuss start/1.
- Guides
- Topics