# LibTmux.Action

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

Shared results for explicit pane, window and session actions.

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. One-shot actions check the
server incarnation before execution; that check leaves a check/use race.

Ordinary actions return completed, failed, skipped and unknown outcomes.
`value` is populated only for a completed command; `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.

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.

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. WindowLink references are rejected.
See `LibTmux.Pane.split/3`, `LibTmux.Pane.send_text/4` and
`LibTmux.Window.rename/4` for caller examples.

## Members

### Other members

- [`connection/0`](/en/elixir/latest/reference/libtmux-action-connection-0/) (typealias): Explicitly selected one-shot descriptor or pinned qualified connection.
- [`error/0`](/en/elixir/latest/reference/libtmux-action-error-0/) (typealias): An API refusal or a managed execution error retaining its recovery context.
- [`option/0`](/en/elixir/latest/reference/libtmux-action-option-0/) (typealias): A 1..600000ms execution budget, default 5000ms; optional exact session context for physical targets.
- [`result/1`](/en/elixir/latest/reference/libtmux-action-result-1/) (typealias): Canonical action outcome and original transport evidence.
