# libtmux.ConnectOptions

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Lua
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/lua/libtmux/_internal/server.lua#L586
- **Page:** https://libtmux.org/en/lua/v0.1.1/reference/libtmux-connectoptions/

Options for `libtmux.Runtime:connect`.

 Name the server with [`socket_path`](/en/tmux/latest/catalog/formats/socket_path/), or leave it out and let the environment
 or tmux choose. With no [`socket_path`](/en/tmux/latest/catalog/formats/socket_path/), `LIBTMUX_SOCKET_PATH` names a socket
 path (tmux `-S`), else `LIBTMUX_SOCKET` names a socket (`-L`), and with
 neither set tmux gets no socket and picks the server itself: the one in
 `TMUX` inside tmux, otherwise its default socket. A `socket_path` option
 comes first and leaves both variables unread. A variable that is empty or
 only whitespace counts as unset, and `LIBTMUX_SOCKET_PATH` must be an
 absolute path.

 The connection never starts a daemon. A connection that names no socket, or
 names one with `LIBTMUX_SOCKET`, fails with `invalid_endpoint` when tmux
 finds none running. A socket path, from the option or `LIBTMUX_SOCKET_PATH`,
 fails with `invalid_endpoint` when no file is there, and with
 `uncertain_generation` when the file outlived its server.

 A socket path is pinned: commands go through a private link to the socket,
 so a replaced socket stops the handle. Every command also checks the
 daemon's pid, start time and release. A socket name or tmux's own choice has
 no path to pin, so that check is the only identity there.

## Members

### Common operations

- [`binary`](/en/lua/v0.1.1/reference/libtmux-connectoptions-binary/) (attribute): Absolute tmux executable path.
- [`config_path`](/en/lua/v0.1.1/reference/libtmux-connectoptions-config_path/) (attribute): Absolute configuration path.

### Other members

- [`socket_path`](/en/lua/v0.1.1/reference/libtmux-connectoptions-socket_path/) (attribute): Absolute existing daemon socket path.
