LibTmux.Server
Observe and change an existing tmux daemon through an owned Server handle.
Source and package
- Qualified name
-
LibTmux. Server - Package
- libtmux-haskell
- Source
- src/LibTmux/Server.hs
- Other languages
- Perlclass RakuErlangmodule PowerShellcmdlet Juliastruct Elixirstruct Common Lispclass PythonRubyLuaTypeScriptRustGoJavaC#C++SwiftKotlinScalaOCamltypealias F#module Clojurefunction
- LibTmux.Server
-
Description#
A
Serverrepresents one adoption of one endpoint.withServerowns its socket pin, native command clients and cleanup workers. Closing this scope releases those resources; it does not sendkill-server. The tmux nounClientrefers to detached observations inLibTmux.Snapshot.withRuntimeandwithServerIngive several handles shared resource limits and independent Server scopes.capturereturns fully decoded, validated values. Field access and graph navigation are pure. Captures use an observation interval, not an atomic transaction over tmux and operating-system state.renameSession,renameWindowandsetPaneTitleperform explicit mutations against generation-bound references. Earlier observations stay detached.Operational failures use
TmuxException.tryTmuxcatches that type only. Cancellation retains its original exception class. If bounded cleanup cannot finish,cleanupRecoveriesretrieves the owning recovery scope from the exception context. A failed callback remains the primary failure.What is on here
Its exports fall into these groups, in export-list order:
- Open and observe
- Rename and title
- Shared ownership
- Operational failures
- Scope cleanup
- Correlated capture recovery
Members49#
Common operations22#
- Server data type One pinned endpoint and connection generation.
Retaining this value after
withServerorwithServerInkeeps no admission open. - tryTmux function Catch library failures with their exception context. Retain this value when handling an error so cleanup and capture owners stay reachable. Application exceptions and asynchronous cancellation propagate.
- capture function Acquire the complete baseline graph, metadata and attached clients.
Returned values own their data and remain usable after
withServerexits. Capacity and acquisition failure are errors; they never become empty lists. - cleanupRecoveries function Cleanup owners retained by a failed or cancelled scope. The context
comes from
tryTmuxor tryWithContext. Inspection performs no tmux IO. Nested scopes can contribute overlapping owners; inspect and resume each retained responsibility throughinspectCleanupandresumeCleanup. - withRuntime function Own a Runtime for the callback and perform bounded cleanup afterward.
Closing it retires every adopted handle; application-owned threads remain
the application's responsibility. Late adoption fails with
RuntimeClosed. The daemon remains running. - withServerIn function Adopt one endpoint within an existing Runtime and close only that handle
after the callback. Other handles remain admitted under the shared limits;
each adoption has its own
serverGeneration. UsewithServerfor one handle. - awaitMutationRecovery function Wait for the original decoder and native child to retire. This may still
return retained
OutcomeUnknown; it does not wait for a daemon hook job. Cancellation keeps this recovery owner in the new exception context. - captureRecoveries function Capture owners retained in an exception context, including cancellation.
- CleanupRecovery data type Reachable responsibility after an incomplete or failed scope release. Retaining this value keeps its selected cleanup target and Runtime reachable.
- detachMutationRecovery function Relinquish this operation's logical uncertainty. This neither cancels daemon work nor releases native resources, and never repeats the mutation.
- inspectMutationRecovery function Inspect the original operation's logical and physical ownership locally. This performs no tmux command. An unknown outcome does not become success merely because the native child has exited.
- mutationGeneration function Server generation associated with this mutation's recovery owner.
- mutationOperation function Metadata-only identity of the original command.
operationStatusremains available after native cleanup; this value contains no command operands. - MutationOptions data type Per-command deadline, checked before admission. Start from
defaultMutationOptionsand updatetimeoutin seconds. - mutationRecoveries function Recover the exact operation after failure, timeout or cancellation. The
context comes from
tryTmuxor tryWithContext; cancellation keeps its original exception class and is not caught bytryTmux. - renameSession function Rename the session targeted by a reference from this Server generation.
The name is literal text. Earlier
Snapshotvalues keep their old names; callcapturefor a new observation. UserenameSessionWithfor a deadline. - renameWindow function Rename one physical window across all its session links. The label retains
bytes through
TmuxText; tmux may reject names its release does not accept. Format-looking text stays literal. SeerenameWindowWithfor a deadline. - renameWindowWith function
renameWindowwith an explicit deadline. Success confirms the primary command's response, not completion of background jobs started by hooks.captureobserves the current label; existing snapshots remain detached. - resumeMutationRecovery function Resume existing native cleanup and decoder ownership, without repeating the command. Allocation failure retains the same recovery owner.
- setPaneTitle function Set the literal title of a pane from this Server generation. The pane's
application can replace it later. Use
setPaneTitleWithfor a deadline. - TmuxException data type Library operational failures. Context-preserving catching retains any cleanup owners; the original application or cancellation exception keeps its class when the callback itself failed.
- withServer function Open one handle, run the callback, then perform bounded owned cleanup.
Cleanup never replaces a callback exception. Incomplete cleanup raises
CleanupFailedafter success, or annotates the original callback failure with a reachableCleanupRecovery. No daemon shutdown is requested.
Other members27#
- awaitCleanup function Wait for this target's physical cleanup, then inspect its logical debt.
The wait has no deadline.
Cancellation or failure preserves an annotated cleanup owner. Use
resumeCleanupwhen the caller requires a bounded attempt. - CaptureRecovery data type A reachable owner for one failed or cancelled capture. The receipt holds metadata only; the Runtime retains any remaining native and logical owners.
- cleanupFailure function Exception that interrupted the original cleanup attempt, when there was one. Pending ownership alone need not have an associated exception.
- cleanupObservation function The cleanup metadata recorded when this recovery owner was attached.
- CleanupStatus data type Local observations of the selected physical and logical responsibility. Each inspection returns new metadata; it performs no tmux operation.
- defaultMutationOptions function One second for command submission and its complete response.
- detachCaptureRecovery function Explicitly detach logical uncertainty while preserving native ownership.
- detachUnresolved function Relinquish one logical operation from this cleanup scope. This releases no native resources and does not prove that daemon-side work completed.
- inspectCaptureRecovery function Observe logical outcome, decoder ownership and native cleanup locally. This reads runtime metadata and performs no tmux command.
- inspectCleanup function Inspect current owned cleanup and logical uncertainty without tmux IO.
- MutationRecovery data type Reachable ownership for one failed or cancelled mutation. The receipt
retains metadata only; the Runtime retains outstanding native and logical
owners. Recovery never repeats the command. See
LibTmux.Server. - Operation data type Metadata-only operation identity, readable after responsibility retires. Its owning scope controls advancement and explicit detachment.
- operationStatus function Read retained operation metadata, including after its physical cleanup.
- Outcome data type First caller result. Later evidence can retire responsibility without
rewriting
OutcomeUnknownorConnectionRetired. - ReadRecovery data type Logical responsibility and an operation's physical owners, observed together. A released native child does not establish a daemon-side command outcome.
- recoveryGeneration function Correlate the failed capture with its Server generation.
- recoveryOperation function Metadata-only operation identity for the failed capture.
- renameSessionWith function
renameSessionwith an explicittimeout. A known primary rejection raisesMutationRejected; an applied command with a failed hook raisesMutationAppliedWithErrors. Neither result implies rollback. - resumeCaptureRecovery function Resume existing cleanup without dispatching the capture again.
- resumeCleanup function Retry bounded owned cleanup. An incomplete result retains this owner; the operation does not retry a tmux command or release logical uncertainty.
- Runtime data type Shared resource limits and cleanup ownership for Server handles. Create
one with
withRuntime, then adopt endpoints throughwithServerIn. DetachedSnapshotvalues retain no Runtime. - serverConfig function Configure an existing socket, resolving
tmuxthrough PATH when opened. The private pin uses the socket's parent directory. The capture timeout is two seconds; callers can change it before opening a Server scope. - ServerConfig data type Pure configuration, checked when
withServerorwithServerInopens the handle. Paths retain POSIX bytes; no text decoding or shell interpretation occurs. - serverGeneration function The handle's opaque generation, available without contacting tmux.
- setPaneTitleWith function
setPaneTitlewith an explicit deadline. Missing panes fail withMutationRejected. Foreign and offline references fail withInvalidTargetbefore dispatch. No mutation retries after cancellation or timeout. - Stage data type Last observed progress. Publishing an uncertain
Outcomedoes not advance this stage or establishOperationComplete. - Status data type Progress, published result and responsibility are independent observations. A retained uncertain operation still consumes admission and its lane permit.
Referenced by#
- LibTmux module
Guides#
Pages that discuss LibTmux.Server.
In other ports#
A tmux server
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| PowerShell | Lib This cmdlet constructs a shared .NET LibTmux.Server handle without contacting tmux. |
| Julia | Lib Server describes an endpoint without contacting tmux. Read its hierarchy with snapshot. |
| Erlang | tmux open/1 observes an existing daemon and starts an endpoint owner. Domain rows remain immutable values. |
| Elixir | Lib Server describes an existing server by executable and socket. It neither connects nor reserves the server’s identity. |
| Common Lisp | libtmux: client is a connection scope with one external-operation lease. Closing it cancels owned work and leaves the tmux daemon alive; daemon owns a daemon the library started. |
| TypeScript | server |
| Rust | server |
| Go | tmux |
| Java | io |
| Clojure | libtmux Opens a closeable Java server client for an explicit endpoint. Acquisitions return persistent maps with explicit Java references for effects. |
| Kotlin | io |
| Scala | io |
| C# | Lib |
| F# | Lib This F# module provides functions over the shared .NET LibTmux.Server type. |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux A client is a live, generation-bound server connection. Endpoint describes a socket without connecting; closing a client releases its resources. |
| Perl | Lib Construction records connection settings without tmux I/O. Optional LibTmux::Async::Server returns standard Future results for operations. |
| Raku | Lib |