Core Library0.xAPI Reference

Choose documentation 1

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

class libtmux-lua latest

ConnectOptions

Options for libtmux.Runtime:connect().

Source and package
Qualified name
libtmux.ConnectOptions
Module
libtmux
Package
libtmux
Source
lua/libtmux/_internal/server.lua
class libtmux.ConnectOptions

Description#

Name the server with socket_path, or leave it out and let the environment or tmux choose. With no 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.

Members3#

Common operations2#

Other members1#

Esc

Type to search.

Reference previewOpen reference