LibTmux.Server (libtmux v0.0.1-alpha.1)

Copy Markdown View Source

An explicit local tmux server descriptor.

new/1 performs no I/O. One-shot commands use an absolute executable and socket with -N, so they cannot start a missing server or attach a client. Configured server hooks remain environmental effects. Reads observe an interval; one-shot identity checks leave a check/use race. Persistent incarnation-bound mutations require a separately qualified connection.

Summary

Types

Descriptor inputs; executable, socket and cwd are absolute NUL-free paths.

t()

An explicit local server descriptor; constructing it neither connects nor reserves server identity.

Functions

Constructs a descriptor for an existing server without connecting or creating it.

Runs one trusted command without attaching; returns bounded output and exit evidence.

Captures a new graph explicitly, with bounded work and read retries.

Captures a graph or raises the same structured capture error.

Types

option()

@type option() ::
  {:executable | :socket | :cwd, String.t()}
  | {:env, %{optional(binary()) => binary()}}

Descriptor inputs; executable, socket and cwd are absolute NUL-free paths.

t()

@type t() :: %LibTmux.Server{
  cwd: String.t(),
  env: %{optional(binary()) => binary()},
  executable: String.t(),
  socket: String.t()
}

An explicit local server descriptor; constructing it neither connects nor reserves server identity.

Functions

new(options)

@spec new([option()]) :: t()

Constructs a descriptor for an existing server without connecting or creating it.

run(server, command, options \\ [])

Runs one trusted command without attaching; returns bounded output and exit evidence.

snapshot(server, options \\ [])

@spec snapshot(t(), [LibTmux.Capture.option()]) ::
  {:ok, LibTmux.Snapshot.t()} | {:error, LibTmux.Error.t()}

Captures a new graph explicitly, with bounded work and read retries.

snapshot!(server, options \\ [])

@spec snapshot!(t(), [LibTmux.Capture.option()]) :: LibTmux.Snapshot.t()

Captures a graph or raises the same structured capture error.