# LibTmux.Control.start_link/1

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/control.ex#L72
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-control-start_link-1/

```
start_link(options)
@spec start_link([start_option()]) ::
        {:ok, pid(), t()} | {:error, LibTmux.Error.t()}
```

Starts a linked connection and returns `{:ok, root, control}`.

Require `server: %LibTmux.Server{}`, `session: {:existing, "$id"}` and
`lane: :host_qualified`. No session is created. The attachment is visible in
tmux's client counts and can update session state. `no-output,ignore-size`
suppresses pane output and excludes this client from window sizing.

`timeout` defaults to 5000ms and accepts 1..600000ms. One budget covers input
preparation, Root startup, bootstrap, ready waiting and handoff. A fresh
factory returns a ready handle. Runtime failures return a structured error;
invalid trusted options raise `ArgumentError`. Ordinary OTP links remain:
an asynchronous fatal Root exit can terminate a non-trapping caller.

Failed startup fences its lifetime and requests exact-Root cleanup. Error
details distinguish observed Root exit from a kill request; unknown native
cleanup is never success. OTP can await Root exit after its initialization
timer expires, so a strict wall-clock caller-return bound remains unqualified.

Optional `capacity`, `metadata_capacity` and `waiter_capacity` default to 32
and accept 1..256. `retention_ms` defaults to 60000 and accepts 1..600000.

Ready connections buffer at most 64 KiB or 128 stdout chunks behind the
reader. Overflow closes the whole epoch with `resource_limit`; it never
replays commands. These receive limits do not cap borrowed-server memory.

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

## Parameters

- `options` (`[start_option()]`)
