# Libtmux_unix.Client.connect

- **Module:** Libtmux_unix
- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L189
- **Public owner:** Libtmux_unix
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix-client-connect/

```
val connect :
  ?cleanup:Cleanup.t ->
  ?binary:string ->
  ?timeout:float -> Libtmux.Endpoint.t -> (t, Libtmux.Error.t) result
```

Attach to an existing local daemon with at least one session. The caller and daemon must share the PID namespace and filesystem. A local socket pathname alone does not establish these preconditions. `timeout` is the maximum seconds per control exchange, defaulting to one second. Requires Linux pidfd support. The client belongs to the current domain. Initial and auxiliary attachments suppress tmux's [`update-environment`](/en/tmux/latest/catalog/options/update-environment/) behavior.

## Parameters

- `cleanup?` (`Cleanup.t`)
- `binary?` (`string`)
- `timeout?` (`float`)
- `arg1` (`Libtmux.Endpoint.t`)
