Core LibraryalphaAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

function libtmux-elixir latest

Control.start_link/1

Starts a linked connection and returns {:ok, root, control}.

Source and package
Qualified name
LibTmux.Control.start_link/1
Module
LibTmux
Declared in
Control
Package
libtmux
Source
lib/libtmux/control.ex
start_link(options) @spec start_link([start_option()]) :: {:ok, pid(), t()} | {:error, LibTmux.Error.t()}

Description#

Require server: %LibTmux.Server{}, session: {:existing, "$id"} and lane: :host_qualified. No session is created. The attachment is visible in tmux's client counts and can update session state. no-output,ignore-size suppresses pane output and excludes this client from window sizing.

timeout defaults to 5000ms and accepts 1..600000ms. One budget covers input preparation, Root startup, bootstrap, ready waiting and handoff. A fresh factory returns a ready handle. Runtime failures return a structured error; invalid trusted options raise ArgumentError. Ordinary OTP links remain: an asynchronous fatal Root exit can terminate a non-trapping caller.

Failed startup fences its lifetime and requests exact-Root cleanup. Error details distinguish observed Root exit from a kill request; unknown native cleanup is never success. OTP can await Root exit after its initialization timer expires, so a strict wall-clock caller-return bound remains unqualified.

Optional capacity, metadata_capacity and waiter_capacity default to 32 and accept 1..256. retention_ms defaults to 60000 and accepts 1..600000.

Ready connections buffer at most 64 KiB or 128 stdout chunks behind the reader. Overflow closes the whole epoch with resource_limit; it never replays commands. These receive limits do not cap borrowed-server memory.

See the worked example.

Parameters

Discussed in Execution ownership

Esc

Type to search.

Reference preview Open reference