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.

MoreLess about this notice

module libtmux-erlang

tmux_program

Run an application in a PTY on a private tmux server.

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

Description

Pass an absolute path to tmux and a list of binary arguments starting with the application's absolute path. Releases from tmux 3.8 support the history counters used in the result. Check the minimum with tmux_capability:describe/1 and the feature program_history.

run/3 starts, awaits and releases the program. Use start/3 when you need to send input, wait from more than one process or request an early stop. The caller that starts the program owns its lifetime.

See Run a program in a private terminal for an executable example, capture limits and cleanup recovery.

Members12 members

Common operations1

  • start/3 function Admit a run and return its handle while native setup continues. The deadline covers setup, execution and capture. Cleanup is collected separately. Eight program slots are shared across each Erlang node.

Other members11

  • await_started/2 function Wait for the launch gate to open. Use await/2 for the application result.
  • await/2 function Wait for the result and cleanup receipt. An await_timeout leaves the run active.
  • capture/0 type The verified application exit, rendered terminal bytes and cleanup receipt.
  • history/0 type The tmux history size, limit, line counters and generation.
  • options/0 type Resource limits and environment for an owned launch.
  • release/1 function Discard a completed result. Native resources with unconfirmed retirement keep their slot.
  • result/0 type A completed capture or a structured failure. A nonzero exit can have a complete capture.
  • run/3 function Start a private terminal, await its result and release the result handle.
  • send_text/2 function Send up to 2,000 literal input bytes to the live program. The program's terminal settings govern how it reads the bytes. A second input request returns program_input_busy while the first occupies the input slot.
  • stop/1 function Request stop. Use await/2 to collect the outcome and confirm retirement.
  • t/0 type A handle for one owned program and its retained result.
Esc
Search in

Type to search.

Reference previewOpen reference