# LibTmux.Control.execute/3

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/control.ex#L232
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-control-execute-3/

```
execute(control, request, options \\ [])
@spec execute(t(), LibTmux.Control.Request.t(), [
        call_option()
      ]) ::
        {:ok, LibTmux.Operation.result()}
        | {:error,
           LibTmux.Error.t()
           | LibTmux.Control.ExecutionError.t()}
```

Executes one qualified request, returning its result after wire retirement and record reclamation. Repeated successful calls need no manual forget.

The default 5000ms budget covers preparation, admission, execution and
collection. Failed, skipped and unknown canonical outcomes remain values;
acknowledgement does not establish external program completion.

Pre-admission errors have no-write certainty. An error after admission is
a `LibTmux.Control.ExecutionError` with the exact Operation and retained or
lost context. Inspect that handle when available; never replay on timeout.
The original caller owns recovery: its death permits reclamation after wire
retirement, even if it passed the handle to another process. A live caller's
timeout leaves the record subject to normal retention and explicit forget.
`Operation.status/1` and `Operation.result/1` inspect it without a waiter.
A new await needs its own slot; the expired collector releases its slot
asynchronously when the owner processes closure.
Use `submit/3` when a retained handle is required after successful waiting.

    alias LibTmux.Control

    Control.execute(control, LibTmux.Control.Request.field("pid"))

## Parameters

- `control` (`t()`)
- `request` (`LibTmux.Control.Request.t()`)
- `options` (`[call_option()]`)
