# tmux client library for Erlang

Source: https://libtmux.org/en/erlang/latest/core/

> tmux client library for Erlang. Control tmux, connect to and create servers, navigate sessions, windows, and panes, send keys, capture pane contents

Control tmux, connect to and create servers, navigate sessions, windows, and panes, send keys, capture pane contents.

## At a glance

| Type | Wraps |
| ---- | ----- |
| [`tmux_server:t/0`](https://libtmux.org/en/erlang/latest/reference/t-tmux_server-t-0/) | A tmux server |
| [`#tmux_model:session{}`](https://libtmux.org/en/erlang/latest/reference/tmux_model-session/) | A session, ID `$n` |
| [`#tmux_model:window{}`](https://libtmux.org/en/erlang/latest/reference/tmux_model-window/) | A physical tmux window; session membership uses window links, ID `@n` |
| [`#tmux_model:pane{}`](https://libtmux.org/en/erlang/latest/reference/tmux_model-pane/) | A pane in a window, ID `%n` |

## Typed API

- Typed objects instead of parsed format strings: [`#tmux_model:pane{}`](https://libtmux.org/en/erlang/latest/reference/tmux_model-pane/)
- Addressing by tmux ID: [`tmux_model:pane_id/0`](https://libtmux.org/en/erlang/latest/reference/t-tmux_model-pane_id-0/)
- Filtering and queries over tmux objects: [`tmux_filter`](https://libtmux.org/en/erlang/latest/reference/tmux_filter/)
- Typed errors instead of exit codes and stderr: [`tmux_operation:failure/0`](https://libtmux.org/en/erlang/latest/reference/t-tmux_operation-failure-0/)

## What you get over the tmux CLI

- Connect to or start a tmux server: [`tmux_server:open/1`](https://libtmux.org/en/erlang/latest/reference/tmux_server-open-1/)
- Traversal from a server down to its panes: [`tmux_snapshot:panes/1`](https://libtmux.org/en/erlang/latest/reference/tmux_snapshot-panes-1/)
- Send keys to a pane: [`tmux_pane:send_keys/2`](https://libtmux.org/en/erlang/latest/reference/tmux_pane-send_keys-2/)
- Capture pane contents: [`tmux_pane:capture/2`](https://libtmux.org/en/erlang/latest/reference/tmux_pane-capture-2/)
- Arguments passed as a list, with no shell quoting: [`tmux_command`](https://libtmux.org/en/erlang/latest/reference/tmux_command/)
- A typed error when the running tmux lacks a feature: [`tmux_capability`](https://libtmux.org/en/erlang/latest/reference/tmux_capability/)
- Isolated tmux servers for tests: [`tmux_server:start_owned/1`](https://libtmux.org/en/erlang/latest/reference/tmux_server-start_owned-1/)
- Async operations: [`tmux_operation`](https://libtmux.org/en/erlang/latest/reference/tmux_operation/)

- [Guides](https://libtmux.org/en/erlang/latest/guides/): Installation, queries and owned operations.
- [Topics](https://libtmux.org/en/erlang/latest/topics/): Object identity, command execution and compatibility.
- [Examples](https://libtmux.org/en/erlang/latest/examples/): Complete programs from the tested source checkout.
- [API reference](https://libtmux.org/en/erlang/latest/reference/): Native records, modules, functions and types.
