# tmux_server:command/3

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_server.erl#L252
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_server-command-3/

```
command(Server, Command, Options)
-spec command(t(), tmux_command:t(), command_options()) ->
                 {ok, tmux_operation:completed()} |
                 {error, tmux_operation:failure()}.
```

Execute one validated command and await its result. Performs I/O. The result preserves stdout, stderr, exit status and cleanup certainty. Use `tmux_operation:start/3` to submit without blocking this caller. A timeout or cancellation cannot reverse effects that may already have reached tmux. Values from domain command builders keep their captured endpoint origin. Another endpoint returns different_owner with submitted = false before any native preflight or execution. Raw commands do not carry that origin.

## Parameters

- `Server` (`t()`)
- `Command` (`tmux_command:t()`)
- `Options` (`command_options()`)

## Guides

Pages that discuss `command/3`.

- [Apply configuration and await its completion signal](/en/erlang/latest/guides/configuration/)

## In other ports

Run a tmux command this port does not model

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.cmd`](/en/py/latest/reference/libtmux-server-cmd/) (method) |
| Ruby | [`LibTmux::Server#run`](/en/ruby/latest/reference/libtmux-server-run/) (method) |
| Lua | [`libtmux.Server:command`](/en/lua/latest/reference/libtmux-server-command/) (method) |
| Elixir | [`LibTmux.Server.run/3`](/en/elixir/latest/reference/libtmux-server-run-3/) (function). Runs one trusted `Command` without attaching a client and returns bounded output with exit evidence. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`server.Server.cmd`](/en/ts/latest/reference/server-server-cmd/) (method) |
| Rust | [`server.Server.cmd`](/en/rs/latest/reference/server-server-cmd/) (method) |
| Go | [`tmux.Server.Cmd`](/en/go/latest/reference/tmux-server-cmd/) (method) |
| Java | [`io.github.libtmux.Server.cmd`](/en/java/latest/reference/io-github-libtmux-server-server-cmd/) (method) |
| C# | no equivalent on `Server` |
| C++ | no equivalent on `Server` |
| Swift | no equivalent on `Server` |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | [`LibTmux::Server::cmd`](/en/perl/latest/reference/libtmux-server-cmd/) (method). Checked literal argument vector; no shell wrapper or implicit tmux command list. |

No equivalent is recorded in PowerShell, Julia, Common Lisp, Clojure, Kotlin, Scala or F#.
