Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
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-elixir

Action

Shared results for explicit pane, window and session actions.

Source and package
Qualified name
LibTmux.Action
Module
LibTmux
Package
libtmux
Source
lib/libtmux/action.ex
LibTmux.Action

Description

Pass a LibTmux.Server for one-shot execution or a LibTmux.Control for managed execution in its qualified connection. No action changes transport, replays a mutation or refreshes an observation. Targeted one-shot actions check the server incarnation with an unaliased native list-commands read. The check leaves a check/use race. Hooks on the requested action still run.

Ordinary actions return {:ok, result} only for completed commands. Failed, skipped and unknown outcomes return {:error, %LibTmux.Action.CompletionError{result: original_result}}. value holds the completed command's value; details retains the transport's original bounded evidence. Domain bang functions return the completed value or raise LibTmux.Action.CompletionError with the original unsuccessful result. Acknowledgement does not prove that a program processed input or finished running.

API errors use LibTmux.Error; admitted control errors preserve the recovery handle in LibTmux.Control.ExecutionError. Domain bang functions raise these errors unchanged. Lower-level LibTmux.Control and LibTmux.Operation bang functions retain canonical outcomes as values.

Action errors with kind :invalid_command include a validation path such as [:options, :size] and a bounded details.reason describing accepted inputs. The reason appears in the exception message; rejected values are not retained in diagnostic details. Targeted one-shot actions validate both native process specifications before the identity read. Session creation has no observed target; it validates its command and runs without an identity read. Native byte/count refusals use paths such as [:process, :argv] or [:process, :frame]. Preparation does not check filesystem existence or guarantee execution.

A nonzero one-shot client exit reports :failed with :observed certainty: its exit status is observed, not an authenticated tmux command reply or proof that no effects occurred.

Kill actions run one-shot only: a Control connection returns unsupported_transport before any I/O, because it cannot kill what it is attached to. A kill command prints nothing, so a completed result has the value :ok.

Optional session context checks physical membership at tmux's command resolution. It does not bind a particular WindowLink index when a window has multiple links in that session. LibTmux.WindowLink.unlink/3 acts on one captured binding. See LibTmux.Pane.split/3, LibTmux.Pane.send_text/4 and LibTmux.Window.rename/4 for caller examples.

Members9 members

Esc
Search in

Type to search.

Reference previewOpen reference