# libtmux.control:open-connection

- **Package:** libtmux/control
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/control.lisp#L82
- **Public owner:** libtmux.control
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-control-open-connection/

```
(open-connection client session &key (timeout 30) (request-limit 16) (event-limit 256) (event-byte-limit 4194304) (reply-byte-limit 1048576))
```

Attach a separate owned control connection to a captured SESSION.
CLIENT supplies the core endpoint and authority. Startup preflights the target
and requires the live daemon to be >=3.8. TIMEOUT bounds startup admission and
supervised execution; platform preparation and cleanup add caller wall time.
REQUEST-LIMIT includes active and queued work. Events drop oldest entries at
EVENT-LIMIT or EVENT-BYTE-LIMIT and report loss. REPLY-BYTE-LIMIT bounds each
request's retained output; overflow closes the connection with a cause.
This call blocks until ready or failed. All limits must be positive integers
except the nonnegative real TIMEOUT. No daemon is started or terminated.
Attachment preserves the stored session environment; native attach hooks and
server lifecycle policies still apply. Readiness checks the observed daemon
witness after attachment, so a refused candidate may have appeared briefly.

See also: `libtmux.control:close-connection`, `libtmux.control:next-event`, `libtmux.control:reconnect`, `libtmux.control:submit-command`, `libtmux.control:with-connection`.

## Parameters

- `client`
- `session`
- `timeout?`
- `request-limit?`
- `event-limit?`
- `event-byte-limit?`
- `reply-byte-limit?`
