# libtmux::Server::bind_key

- **Module:** libtmux::Server
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/85e8bd603a322dc32bb8b9aeb1a72bcf36945f1d/include/libtmux/server.hpp#L231
- **Page:** https://libtmux.org/reference/cxx/libtmux-server-bind_key/

```
libtmux::Server::bind_key(table: std::string_view, key: std::string_view, command: const std::vector< std::string > &, repeatable: bool = false) -> expected< void, CommandFailure >
```

Bind a key in a key table, and take a binding away again.

The command is argv, not a string, so nothing here has to be quoted for tmux to take it apart again correctly.

A table name containing whitespace is refused. tmux accepts one and then prints it unquoted in `list-keys`, where `-T my table X command` cannot be told apart from the table `my` bound to the key `table` — so a name that survives being listed is required, the same way a target refuses a name that cannot survive being parsed.

Key names are tmux's to check: unlike `send-keys`, `bind-key` reports an unknown one — including an empty one — so there is nothing for this to add, and nothing here repeats it.

`repeatable` is tmux's `-r`, letting the key repeat without the prefix being pressed again.
