Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux-haskell has not been released. Its API may change during development. This site's structure and URLs may change too.

module libtmux-haskell latest

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 Server represents one adoption of one endpoint. withServer owns its socket pin, native command clients and cleanup workers. Closing this scope releases those resources; it does not send kill-server. The tmux noun Client refers to detached observations in LibTmux.Snapshot. withRuntime and withServerIn give several handles shared resource limits and independent Server scopes.

capture returns 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, renameWindow and setPaneTitle perform explicit mutations against generation-bound references. Earlier observations stay detached.

Operational failures use TmuxException. tryTmux catches that type only. Cancellation retains its original exception class. If bounded cleanup cannot finish, cleanupRecoveries retrieves 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:

Operational failures

Members49#

Common operations22#

  • Server data type One pinned endpoint and connection generation. Retaining this value after withServer or withServerIn keeps 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 withServer exits. 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 tryTmux or tryWithContext. Inspection performs no tmux IO. Nested scopes can contribute overlapping owners; inspect and resume each retained responsibility through inspectCleanup and resumeCleanup.
  • 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. Use withServer for 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. operationStatus remains available after native cleanup; this value contains no command operands.
  • MutationOptions data type Per-command deadline, checked before admission. Start from defaultMutationOptions and update timeout in seconds.
  • mutationRecoveries function Recover the exact operation after failure, timeout or cancellation. The context comes from tryTmux or tryWithContext; cancellation keeps its original exception class and is not caught by tryTmux.
  • renameSession function Rename the session targeted by a reference from this Server generation. The name is literal text. Earlier Snapshot values keep their old names; call capture for a new observation. Use renameSessionWith for 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. See renameWindowWith for a deadline.
  • renameWindowWith function renameWindow with an explicit deadline. Success confirms the primary command's response, not completion of background jobs started by hooks. capture observes 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 setPaneTitleWith for 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 CleanupFailed after success, or annotates the original callback failure with a reachable CleanupRecovery. 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 resumeCleanup when 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 OutcomeUnknown or ConnectionRetired.
  • 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 renameSession with an explicit timeout. A known primary rejection raises MutationRejected; an applied command with a failed hook raises MutationAppliedWithErrors. 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 through withServerIn. Detached Snapshot values retain no Runtime.
  • serverConfig function Configure an existing socket, resolving tmux through 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 withServer or withServerIn opens 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 setPaneTitle with an explicit deadline. Missing panes fail with MutationRejected. Foreign and offline references fail with InvalidTarget before dispatch. No mutation retries after cancellation or timeout.
  • Stage data type Last observed progress. Publishing an uncertain Outcome does not advance this stage or establish OperationComplete.
  • Status data type Progress, published result and responsibility are independent observations. A retained uncertain operation still consumes admission and its lane permit.

Referenced by#

Guides#

Pages that discuss LibTmux.Server.

In other ports#

A tmux server

Equivalents of A tmux server in other languages
Language Equivalent
Python libtmux.Server
Ruby LibTmux::Server
Lua libtmux.Server
PowerShell LibTmux\New-TmuxServer This cmdlet constructs a shared .NET LibTmux.Server handle without contacting tmux.
Julia LibTmux.Server Server describes an endpoint without contacting tmux. Read its hierarchy with snapshot.
Erlang tmux_server open/1 observes an existing daemon and starts an endpoint owner. Domain rows remain immutable values.
Elixir LibTmux.Server Server describes an existing server by executable and socket. It neither connects nor reserves the server’s identity.
Common Lisp libtmux:client 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.Server
Rust server.Server
Go tmux.Server
Java io.github.libtmux.Server
Clojure libtmux.core/open! Opens a closeable Java server client for an explicit endpoint. Acquisitions return persistent maps with explicit Java references for effects.
Kotlin io.github.libtmux.kotlin.Server
Scala io.github.libtmux.scaladsl.Server
C# LibTmux.Server
F# LibTmux.FSharp.Server This F# module provides functions over the shared .NET LibTmux.Server type.
C++ libtmux::Server
Swift Server
OCaml Libtmux_unix.Client.t A client is a live, generation-bound server connection. Endpoint describes a socket without connecting; closing a client releases its resources.
Perl LibTmux::Server Construction records connection settings without tmux I/O. Optional LibTmux::Async::Server returns standard Future results for operations.
Raku LibTmux::Server
Esc

Type to search.

Reference previewOpen reference