Core LibraryunreleasedAPI reference

Choose documentation 2

latest

Current version

latest
English

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

MoreLess about this notice

function libtmux-ocaml

Libtmux_unix.with_private_daemon

Run f against a tmux daemon this call starts and owns, then stop it. The daemon listens on a socket in a fresh directory, created mode 0700 under root (default: the system temporary directory) and named with the prefix libtmux-ocaml-. It reads config_file, or nothing when none is given, instead of any default configuration. Neither TMUX nor TMUX_PANE reaches it. A root whose socket path would exceed the 107 bytes of a Unix socket address returns Libtmux.Error.Invalid_input before anything is created.

Source and package
Qualified name
Libtmux_unix.with_private_daemon
Declared in
Libtmux_unix
Package
libtmux-unix
Source
unix/libtmux_unix.mli
val with_private_daemon : ?cleanup:Cleanup.t -> ?binary:string -> ?config_file:string -> ?root:string -> ?session:string -> ?timeout:float -> (Libtmux.Endpoint.t -> 'a) -> ('a, Libtmux.Error.t) result

Public owner: Libtmux_unix

Description

f receives the Libtmux.Endpoint.t once the socket answers, within timeout seconds (default 5). The daemon stays alive until it is stopped, even with no session. Client.connect needs a session to attach to, so pass session to start the daemon with one detached session of that name, with a single window named main running /bin/cat -u, or create the first session with Workspace.submit_bootstrap. Close every client made for endpoint before f returns.

On every exit of f, including an exception, the daemon is terminated and reaped, the call checks that nothing answers the socket, and the directory is removed. An exception from f propagates after cleanup, and a cleanup failure never replaces it; failures are retained in cleanup. When f returns, a cleanup failure is the result. A daemon that still answers, or one that cannot be reaped, leaves the directory in place and returns Libtmux.Error.Filesystem or the cleanup error with its path. Normal return gives Ok of the value of f.

Parameters

Recorded calls

source calls
No call edges in the OCaml model.

The OCaml 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_unix.with_private_daemon.

Esc
Search in

Type to search.

Reference previewOpen reference