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.

class libtmux-raku latest

LibTmux.Attachment

Source and package
Qualified name
LibTmux::Attachment
Declared in
LibTmux
Package
LibTmux
Source
lib/LibTmux/Attachment.rakumod
Anonymous class

Description#

Explicit interactive terminal ownership

spawn binds stdin and stdout to the supplied open terminal handle. It never inherits the calling program's terminal implicitly. The caller owns that handle and its terminal output; Attachment owns the child and bounded binary stderr. close stops and reaps only that child, leaves the handle open, and does not stop the daemon or other clients. Cancellation applies to startup, not the later interactive lifetime. Use close to end that lifetime.

spawn proves OS process creation only. state starts as AttachmentPending; inspect-client makes one explicit listing and records AttachmentAttached when the owned PID is present. Child exit independently records AttachmentExited. There is no polling loop or implicit readiness claim. An event from a separately owned control connection may supply application-specific readiness evidence.

The initial session read checks Linux daemon identity, and the attach command runs in a PID/start-time fence. The Engine's documented same-PID/same-second replacement and normal builtin-dispatch assumptions also apply here. An exit Result describes the tmux client process, not the lifetime of its session.

Members14#

  • AttachmentState enum State established by process completion or the most recent explicit inspection.
  • clone method Refuse copying an owner, which would duplicate cleanup authority over one child.
  • close method Terminate and reap only this child. The caller's terminal handle stays open.
  • close-async method Share idempotent child cleanup; failure to reap breaks the returned Promise.
  • endpoint: Endpoint:D property Socket and executable configuration used for this child and explicit inspections.
  • incarnation: Incarnation:D property Daemon identity captured before attachment; a replacement daemon is rejected.
  • inspect-client method Perform one explicit listing. Nil means no matching attached client was observed.
  • max-stderr-bytes: Positive:D property Retained stderr byte limit; exceeding it terminates the child and fails when-exited.
  • new method Construction requires spawn so an unstarted process owner cannot escape.
  • pid method Owned OS child identity; a nonzero PID does not establish attachment readiness.
  • session: SessionId:D property Initial session ID; later interactive switching does not change this value.
  • spawn method Spawn a tmux client on a supplied terminal. This does not prove attachment.
  • state method Last explicit attachment observation, or the independently observed process exit.
  • when-exited method Resolve after the child exits and stderr is drained, preserving its exit status.
Esc

Type to search.

Reference previewOpen reference