# LibTmux.Control.submit/3

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/control.ex#L215
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-control-submit-3/

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

Admits one request and returns its retained operation handle.

`timeout` defaults to 5000ms and covers validation, admission, queueing,
writes and replies under one monotonic deadline. Request binaries are
detached before publication. Invalid input, overload or stale context before
admission returns a no-write error. Every successful admission returns its
Operation, even if its context disappears before publication. Inspect that
handle for the eventual canonical result or an explicit lost-context error.

Closing the connection can affect sibling operations. Command replies do
not prove external program exit. Caller timeout does not authorize replay.

See the [worked example](advanced-execution.html).

## Parameters

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

## tmux command

The tmux commands behind `submit/3`.

- [`display-message`](/en/tmux/latest/manual/display-message/) (the request reads a field)
- [`set-option`](/en/tmux/latest/manual/set-option/) (the request sets a user option)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_display_message_entry`](/en/tmux/latest/reference/c-variable-cmd_display_message_entry/) (attribute)
- [`cmd_display_message_exec`](/en/tmux/latest/reference/c-function-cmd-display-message-c-cmd_display_message_exec/) (function)
- [`cmd_set_option_entry`](/en/tmux/latest/reference/c-variable-cmd_set_option_entry/) (attribute)
- [`cmd_set_option_exec`](/en/tmux/latest/reference/c-function-cmd-set-option-c-cmd_set_option_exec/) (function)

## Guides

Pages that discuss `submit/3`.

### Concepts

- [Read values, execute explicitly](/en/elixir/pr-173/concepts/mental-model/)

### Topics

- [Execution ownership](/en/elixir/pr-173/topics/ownership/)
