Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

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

module libtmux-erlang latest

tmux_control

Own an explicit persistent tmux control attachment.

Source and package
Qualified name
tmux_control
Package
libtmux_erlang
Source
apps/libtmux_erlang/src/tmux_control.erl
tmux_control

Description#

attach/3 attaches to an existing session from tmux_server and verifies the daemon identity on that connection. The caller owns its lifetime. Attachment changes the session's attached-client count. The command client uses no-output and ignore-size; -E skips attachment's environment update. The library issues no session-option writes or session-creation commands. Configured hooks and native lifetime policies can still change state, including on failed attach or detachment. Those effects are not rolled back. Command submission and terminal streaming are not yet exposed.

Use close/1 before closing the parent endpoint. Parent closing, invalidation or caller death requests retirement, but parent close alone does not prove this client's exit. Control close and status/1 report its native cleanup. Neither detachment nor cancellation reverses remote effects. Application shutdown alone is not a verified cleanup result.

Members6#

Common operations1#

  • close/1 function Retire this control client and its helper without issuing session or daemon destruction commands. Native lifetime policies and detachment hooks may still change state; cleanup does not reverse their effects. Returns ok only after actual retirement. A finite cleanup failure leaves a supervised owner for retry and observation. Successful close is idempotent during the 60-second handle retention period.

Other members5#

  • attach_options/0 typealias Finite attachment budget, including parent registration, exec and identity. Defaults to 2500 ms.
  • attach/3 function Attach to an existing captured session from this exact endpoint origin. Performs I/O and waits for a same-connection identity probe. Uses attach-session with -E rather than creating a session or writing options. Configured hooks may change state; failure does not reverse their effects. The control client affects attached_count. Unexpected hook-generated reply blocks fail attachment and retire the client.
  • state/0 typealias Connection state, separate from command completion. complete proves native client/helper retirement; pending and incomplete do not. Retained PIDs are diagnostic observations, never permission to signal a process.
  • status/1 function Read retained connection state without a tmux command. Inspect cleanup rather than inferring native exit from the Erlang owner's lifecycle. Closed handles expire after 60 seconds and then return control_expired.
  • t/0 typealias A generation-bound connection handle. Passing it does not transfer lifetime ownership.
Esc

Type to search.

Reference previewOpen reference