# tmux_key:bind/3

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

```
bind(Server, Key, Commands)
-spec bind(tmux_server:t(),
           key(),
           tmux_command:t() | [tmux_command:t(), ...]) ->
              {ok, tmux_operation:completed()} |
              {error, tmux_operation:failure()}.
```

Register commands in the native prefix table with default options. Performs I/O; see `bind/4` for replacement, command parsing and future execution.

## Parameters

- `Server` (`tmux_server:t()`)
- `Key` (`key()`)
- `Commands` (`tmux_command:t() | [tmux_command:t(), ...]`)

## tmux command

The tmux commands behind `bind/3`.

- [`bind-key`](/en/tmux/latest/manual/bind-key/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_bind_key_entry`](/en/tmux/latest/reference/c-variable-cmd_bind_key_entry/) (attribute)
- [`cmd_bind_key_exec`](/en/tmux/latest/reference/c-function-cmd-bind-key-c-cmd_bind_key_exec/) (function)

## Guides

Pages that discuss `bind/3`.

- [Install application keybindings](/en/erlang/latest/guides/keys/)

## In other ports

Bind a key to a tmux command

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.bind_key`](/en/py/latest/reference/libtmux-server-bind_key/) (method) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no equivalent on `Server` |
| Rust | [`server.Server.bind_key`](/en/rs/latest/reference/server-server-bind_key/) (method) |
| Go | [`tmux.Server.BindKey`](/en/go/latest/reference/tmux-server-bindkey/) (method) |
| Java | [`io.github.libtmux.Keys.bind`](/en/java/latest/reference/io-github-libtmux-keys-keys-bind/) (method) |
| C# | [`LibTmux.TmuxKeys.BindAsync`](/en/csharp/latest/reference/libtmux-tmuxkeys-bindasync/) (method) |
| C++ | [`libtmux::Server::bind_key`](/en/cxx/latest/reference/libtmux-server-bind_key/) (method) |
| Swift | no equivalent on `Server` |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |

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