Server.init(tmuxExecutable:configurationFile:environment:)
A server on the socket the environment names, else on the one tmux picks.
Source and package
- Qualified name
-
Server.init(tmux Executable: configuration File: environment:) - Declared in
Server- Package
- libtmux-swift
- Source
- Sources/LibTmux/Server.swift
- init( tmux
Executable : String, configurationFile : String?, environment: [String: String]) -
Description#
LIBTMUX_SOCKET_PATHnames a socket path, passed to tmux as-S. OtherwiseLIBTMUX_SOCKETnames a socket name, passed as-L. With neither set the server'sendpointisEndpoint.tmuxChoice: tmux is passed no socket and chooses the server itself, the one inTMUXinside tmux and the default socket inTMUX_TMPDIRelsewhere. The path wins when both variables are set, as it does for the Python library. A variable that is empty or only whitespace counts as unset, each one on its own, so a blank path leaves a set name in force; any other value is used as written.Name a socket with
init(socketPath:tmuxExecutable:configurationFile:)orinit(socketName:tmuxExecutable:configurationFile:)when the answer must not depend on the environment; those leave both variables unread. Only the two variables are read fromenvironment. Every tmux process the server starts inherits the process's own environment,TMUXincluded.- Parameter environment: where to read the two variables from.
- Throws:
TmuxError.invalidEndpoint(_:)for a socket path that is too long. The error names the length and never the value.
Examples#
let server = try Server()let sessions = try await server.sessions()- Parameters
-
-
environment([String: String]) #
- Raises