# LibTmux::Transport

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Perl
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/core/lib/LibTmux/Transport.pm#L1
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-transport/

```
package LibTmux::Transport;
```

Supervised literal process execution


## RESULTS

[`LibTmux::CommandResult`](/en/perl/latest/reference/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`](/en/perl/latest/reference/libtmux-x-transport/) or [`"Spawn" in LibTmux::X`](/en/perl/latest/reference/libtmux-x-spawn/). No arbitrary descriptor-passing API is selected. Forking hosts with native threads remains unqualified.



## Members

### Other members

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