On this page
Server
- Package
- libtmux-swift
- Source
- Sources/LibTmux/Server.swift
-
A tmux server, addressed by its endpoint.
Serveris a value: copying one is free, copies compare equal, and passing one across a task boundary needs no ceremony. The mutable part — the process boundary and anything cached about the running daemon — lives behind an actor that every copy shares, so two copies of the same server coordinate with each other rather than racing.Discussed in Socket and servers
90 declared, 0 inherited
Members
- !=(_:_:) function Returns a Boolean value indicating whether two values are not equal.
- ==(_:_:) function Returns a Boolean value indicating whether two values are equal.
- breakPane(_:from:named:) method Moves a pane out into a window of its own, and returns its appearance.
- buffer(named:) method Reads a buffer's contents, or
nilif no such buffer exists. - buffers() method The server's paste buffers, most recent first.
- capture(_:includingHistory:) method The pane's visible contents, one line per row. The source read is capped at 1 MiB; use incremental capture for a large scrollback instead of collecting its entire history.
- capture(_:includingHistory:maximumLines:) method Reads the newest rows without collecting older rows that will be discarded.
- capture(_:since:limit:) method Reads only what a pane has printed since
cursor. - clearHistory(_:) method Clears a pane's visible screen and its scrollback.
- clients() method Every client attached to this server.
- connected(attachingTo:_:) method Runs
bodywith every command carried by one live connection instead of a new tmux process each time. - deleteBuffer(named:) method
- detach(_:) method Detaches a client from the server it is attached to.
- detachClients(from:) method Detaches every client attached to a session.
- environment(_:) method Every variable in an environment, in the order tmux printed them.
- environmentValue(_:in:) method What one variable is set to, or
nilwhen it is unset or marked for removal. - format(_:) method Evaluates a tmux format against the server rather than any one object.
- format(_:addressing:) method Evaluates a tmux format against a target named by id.
- format(_:for:) method Evaluates a tmux format and hands back what it printed.
- format(_:for:through:) method Evaluates a tmux format against a pane through one of its window links. See
format(_:for:)-(String,Session). - hash(into:) method Hashes the essential components of this value by feeding them into the given hasher.
- hasSession(_:) method Whether a session by this name or id exists.
- hooks(_:) method Hooks tmux has a command for.
- incarnation() method The running daemon at this endpoint.
- init(socketName:tmuxExecutable:) method
- init(socketPath:tmuxExecutable:) method
- isRunning() method Whether a server is listening on this endpoint.
- join(_:into:direction:size:) method Moves a pane into another window, splitting it.
- kill(_:) method
- killServer() method
- link(_:into:) method Links a window into another session. The same window then appears in both, sharing one id — which is tmux's model, not a copy. The source is global because no existing session-local appearance is involved.
- loadBuffer(from:named:) method Fills a buffer from a file, letting tmux read it.
- move(_:to:) method Moves one window appearance into another session.
- newSession(named:startDirectory:windowName:) method Creates a detached session.
- newWindow(_:_:named:startDirectory:) method Creates a window next to one that already exists and returns its exact appearance.
- newWindow(in:named:startDirectory:) method Creates a window in a session and returns its exact appearance.
- nextLayout(_:) method Cycles a window through tmux's preset layouts.
- option(_:scope:) method The value of one option, or
nilif it is not set in that table. - options(_:) method Every option set in one exact table.
- panes() method Every pane on this server, in tmux's own order. A pane whose window has several session links appears once.
- paste(buffer:into:) method Pastes a buffer into a pane.
- pipe(_:to:) method Copies everything a pane outputs to a shell command, or stops doing so when
commandis omitted. - previousLayout(_:) method
- removeEnvironment(_:in:) method Marks a variable so new processes start without it, even when it is set in the environment tmux itself was started from.
- rename(_:to:) method
- requireRunning() method Throws unless a server is listening.
- resize(_:by:toward:) method Nudges a pane's boundary, leaving the rest of the layout to absorb it.
- resize(_:width:height:) method Sets a pane's size outright.
- respawn(_:running:killingExisting:) method Restarts the command in a pane.
- rotate(_:upward:) method Shifts every pane in a window one position around the layout.
- run(_:) method Runs a list of commands in one tmux invocation.
- run(_:in:) method Runs a shell command line in a pane, as if typed.
- runHook(_:in:) method Runs a hook's commands now, without waiting for what would trigger it.
- saveBuffer(named:to:) method Writes a buffer to a file, letting tmux do the writing.
- select(_:) method
- selectLastPane(in:) method Returns to the pane that was active before the current one.
- selectLastWindow(in:) method Returns to the window that was active before the current one.
- selectLayout(_:_:) method Applies one of tmux's own layouts —
even-horizontal,tiled, and the rest — to a window. - selectNextWindow(in:) method Moves to the next window of a session, wrapping at the end.
- selectPreviousWindow(in:) method
- sendKeys(_:to:literally:) method Sends keys to a pane.
- serverProcessID() method The running server's process id.
- sessions() method Every session on this server, in tmux's own order.
- setBuffer(_:named:) method Puts text into a named buffer.
- setEnvironment(_:to:in:) method Sets a variable, replacing whatever was there.
- setHook(_:to:at:in:) method Binds a command to a hook.
- setOption(_:to:scope:) method Sets an option.
- setTitle(_:of:) method Sets a pane's title. The title is only shown when tmux is configured to display it, but it is always readable through a format.
- signal(_:) method Releases one waiter on
channel. - snapshot() method Reads every object from one daemon incarnation.
- sourceFile(_:) method Loads a tmux configuration file into the running server.
- split(_:direction:size:startDirectory:) method Splits one pane, returning the pane that appeared.
- splitWindow(_:direction:size:startDirectory:) method Splits a window's active pane, returning the pane that appeared.
- startServer() method Starts the server if it is not already running.
- swap(_:with:) method Swaps two window appearances. Their underlying window ids do not change, but both links move to new indices.
- unlink(_:) method Removes one of a linked window's appearances. The window survives while any session still holds it.
- unsetEnvironment(_:in:) method Unsets a variable, leaving no trace of it.
- unsetHook(_:in:) method Unbinds every command from a hook.
- unsetOption(_:scope:) method Puts an option back the way it was before anyone set it.
- using(_:_:) method Runs
bodywith this server inmode. - version() method Which tmux this server runs.
- wait(for:) method Blocks until something signals
channel. - waitForOutput(in:matching:stoppingAt:requiringFreshOutput:timeout:tailLimit:) method Waits until a pane prints something, driven by tmux output events.
- windowLinks() method Every session-local link to a window, in tmux's own order.
- windows() method Every window on this server, in tmux's own order.
- withControlMode(attachingTo:_:) method Opens a control-mode connection for the duration of
body, handing over the connection itself. - endpoint property Where this server listens. Every command carries it, so no call can reach the ambient server by accident.
- mode property How work from this server reaches tmux.
- shellInvocation property How a command running *inside* a pane spells a tmux that reaches this server.
- tmuxExecutable property The tmux this server runs, resolved to a path.