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.

Perl API

class libtmux-perl latest

Transport

Supervised literal process execution

Source and package
Qualified name
LibTmux::Transport
Module
LibTmux
Package
LibTmux
Source
packages/core/lib/LibTmux/Transport.pm

Description#

RESULTS

LibTmux::CommandResult exposes stdout, stderr, exit_code, signal, raw_status, and success. Output remains octets.

The private supervisor owns program signals/groups and reaps the program. It receives CHLD, INT and TERM through a Linux signal descriptor, so child exit cannot wait for a deferred Perl handler. This mask belongs only to the supervisor; the command restores its inherited mask before execution. Application SIGCHLD handlers remain intact; SIGCHLD=IGNORE is refused. Cancellation handles are borrowed and remain open. Cancellation after release can have effects and never implies rollback. Parent death triggers cleanup.

Owned supervisor and command branches close unrelated inherited descriptors through Linux /proc/self/fd, preserving the caller's handles. Native descriptors without close-on-exec cannot leak into a newly started tmux daemon. Only standard streams and each branch's required protocol/cancellation pipes remain open. Enumeration or closure failures prevent execution and throw "Transport" in LibTmux::X or "Spawn" in LibTmux::X. No arbitrary descriptor-passing API is selected. Forking hosts with native threads remains unqualified.

Members2#

  • run method run(argv => [...], stdin => $octets, timeout => $seconds, max_output => $bytes, cancel_fh => $handle) returns a LibTmux::CommandResult. Stdout/stderr are separate octet strings. Nonzero exits are results; spawn, timeout, cancellation, output limits, and supervision failures throw LibTmux::X exceptions. timeout bounds one command's execution loop, excluding supervisor setup, async queue waiting, and separate cleanup time.
  • start method Return a LibTmux::ProcessJob for an executor adapter.
Esc

Type to search.

Reference previewOpen reference