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
-
Description
Pass a
LibTmux.Serverfor one-shot execution or aLibTmux.Controlfor 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 nativelist-commandsread. 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}}.valueholds the completed command's value;detailsretains the transport's original bounded evidence. Domain bang functions return the completed value or raiseLibTmux.Action.CompletionErrorwith 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 inLibTmux.Control.ExecutionError. Domain bang functions raise these errors unchanged. Lower-levelLibTmux.ControlandLibTmux.Operationbang functions retain canonical outcomes as values.Action errors with kind
:invalid_commandinclude a validationpathsuch as[:options, :size]and a boundeddetails.reasondescribing 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
:failedwith:observedcertainty: 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_transportbefore 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/3acts on one captured binding. SeeLibTmux.Pane.split/3,LibTmux.Pane.send_text/4andLibTmux.Window.rename/4for caller examples.
Members9 members
- connection/0: connection() ::
Lib
Tmux () | Lib.Server .t Tmux () Explicitly selected one-shot descriptor or pinned qualified connection..Control .t - creation_option/0: creation
_option () :: {:timeout, 1..600_000} | {:cwd, binary()} | {:command, :default | {:shell, binary()} | {:argv, [binary(), ...]}} Detached creation on an existing server; default command/shell and directory unless supplied. - creation_value/0: creation
_value () :: %{id: String.t (), ref: nil} A created native ID without a bound reference; capture a new observation before another targeted action. - error/0: error() ::
Lib
Tmux () | Lib.Error .t Tmux () | Lib.Action .Completion Error .t Tmux () An API refusal, unsuccessful outcome or managed execution error retaining recovery context..Control .Execution Error .t - membership_option/0: membership
_option () :: {:timeout, 1..600_000} One deadline for an exact window membership action. - option/0: option() ::
{:timeout, 1..600_000} | {:session, Lib
Tmux ()} A 1..600000ms execution budget, default 5000ms; optional exact session context for physical targets..Ref .t - resize_option/0: resize
_option () :: option() | {:width | :height, 1..10000 | nil} Absolute cell dimensions for a pane or window resize. Supply a width, a height or both. - result/1: result(value) :: %{
outcome: :completed,
certainty: Lib
Tmux (), evidence: atom(), transport: :one_shot | :control, value: value, details: map() } A completed action's value and original transport evidence..Error .certainty - unsuccessful_result/0: unsuccessful
_result () :: %{ outcome: :failed | :skipped | :unknown, certainty: LibTmux (), evidence: atom(), transport: :one_shot | :control, value: nil, details: map() } A failed, skipped or unknown action outcome retained inside CompletionError..Error .certainty