# LibTmux.Transport.OneShot

- **Module:** LibTmux.Transport
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/transport/oneshot.ex#L1
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-transport-oneshot/

Executes one explicitly selected executable with bounded captured output.

This Linux transport owns a native helper and its ordinary finite process
tree. It never uses a shell. A worker owns the Port and observes caller
death; the helper detects pipe closure after worker or VM death.
Target environment entries travel as bytes to child `execve`, preserving
empty values. The helper inherits the trusted host environment; requested
target variables do not configure the helper. `TMUX` and `TMUX_PANE` are
removed from the target environment.

Limits apply per call: stdout defaults to 1 MiB, stderr to 64 KiB, and
retained chunks to 4096. `max_total_bytes` additionally bounds both streams
together; it defaults to their summed limits. Overload returns an error
with a bounded prefix.
Independent caller processes require admission limits at their host or
server boundary; this primitive maintains no shared request queue.

A positive timeout becomes one execution deadline. Retirement can take
up to a separate 750 ms cleanup allowance after expiry. Missing retirement
proof remains `:unknown`. No result authorizes replay. Helper SIGKILL,
hostile escape and uninterruptible kernel tasks are outside the ordinary
tree guarantee. Building the native helper requires a C11 compiler.

## Members

### Common operations

- [`run/3`](/en/elixir/latest/reference/libtmux-transport-oneshot-run-3/) (function): Runs argv without a shell, retaining exit status separately from stdout and stderr.

### Other members

- [`option/0`](/en/elixir/latest/reference/libtmux-transport-oneshot-option-0/) (typealias): Per-call input and capture limits; bytes and chunks are bounded independently.
- [`result/0`](/en/elixir/latest/reference/libtmux-transport-oneshot-result-0/) (typealias): Captured bytes and child exit status after proven owned-process retirement; nonzero exit remains a transport result.
- [`run!/3`](/en/elixir/latest/reference/libtmux-transport-oneshot-run-bang-3/) (function): Runs argv, raising the same structured transport error on failure.
