Core Library0.xAPI reference

Choose documentation 1

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

function libtmux-elixir

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 is TMUX_TMPDIR for the daemon and its panes. The daemon never inherits TMUX or TMUX_PANE, reads :config_file (an empty file by default), and stays up with no session. start/1 returns when the socket answers, or when :timeout (5000 ms by default) ends.

The process that calls start/1 owns 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 with stop/2 as soon as the work is done, or use with_owned/2.

Returns {:error, error} for an invalid option, a socket path that would exceed the 107 usable bytes of sun_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

Recorded calls

source calls
No call edges in the Elixir model.

The 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 material

Pages that discuss start/1.

Esc
Search in

Type to search.

Reference previewOpen reference