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.Snapshot

Detached tmux observations and pure navigation.

Source and package
Qualified name
LibTmux.Snapshot
Package
libtmux-haskell
Source
src/LibTmux/Snapshot.hs
LibTmux.Snapshot

Description#

LibTmux.Server acquires a Snapshot in IO. Every operation in this module reads owned Haskell values, including after the Server closes. Use ordinary lists, comprehensions and folds for application predicates.

Window and Pane are physical entities. A WindowLink identifies an observed session*index*window binding; PaneOccurrence retains that context. paneOccurrences therefore preserves repeated appearances while panes lists each physical pane once.

References compare identity within one Server generation. A lookup reads the supplied snapshot, including a newer snapshot from that same Server. Independent Server scopes have different generations. Resolve an ID again with lookupPaneId when deliberately selecting a newly observed entity.

Observation fields are exported for record dot and local updates. Editing a record does not change a snapshot's indexes or establish provenance. LibTmux.Snapshot.Fixture constructs validated offline snapshots; snapshotOrigin distinguishes them from observations acquired through IO.

What is on here

Its exports fall into these groups, in export-list order:

Members40#

Collections and queries4#

  • sessions function Physical sessions in numeric ID order.
  • windows function Physical windows in numeric ID order, independent of their links.
  • panes function Physical panes in numeric ID order. Use paneOccurrences for link context.
  • clients function Captured attached clients in reported-name and PID order. Names may repeat.

Common operations11#

  • Session data type Detached physical session. Navigate its appearances through WindowLink.
  • SessionRef data type Session targeting identity within a Generation. Compare observations separately when their captured field values matter.
  • Window data type Detached physical window, independent of its session and index appearances.
  • WindowRef data type Physical window targeting identity within a Generation. A window can have several WindowLink appearances.
  • Pane data type Detached physical pane. Its window can appear in several session contexts; PaneOccurrence preserves an appearance without duplicating physical identity.
  • PaneRef data type Physical pane targeting identity within a Generation. This carries identity, while the supplied Snapshot determines the observed values.
  • Snapshot data type Validated metadata, physical graph and attached-client observations. Construction checks every join and forces owned values. List processing and indexed lookup remain pure after the operational Server closes.
  • TmuxText data type A lossless reported label. Equality and ordering compare bytes. String literals use UTF-8; byte constructors also admit non-text data. Conversion functions are exposed in LibTmux.Snapshot.
  • labelFromBytes function Copy bytes into an owned label. This performs no encoding replacement.
  • lookupPaneId function Select the pane observed under an ID in this snapshot.
  • SnapshotOrigin data type Where the validated values were obtained. A server capture does not establish current liveness. Offline namespaces carry no targeting authority.

Other members25#

  • captureInterval function Acquisition bounds attached to a live capture. An unstamped decoded profile stays private; an offline fixture has no external capture interval.
  • CaptureInterval data type Monotonic process-clock bounds around acquisition. These values describe an interval and do not promise an atomic observation or a wall-clock epoch.
  • Client data type A detached client observation, not an operational connection or live ref. The live profile lists attached clients; an offline value may be unattached.
  • ClientAttachment data type An attachment contains this capture's values. It never resolves a retained client name against a later capture. The pane is the session window's global active pane, not an independent client focus; its link retains session context.
  • Generation data type Opaque connection or offline-fixture identity. Independent Server handles receive distinct tokens; named fixtures never equal an adopted endpoint.
  • labelBytes function Exact bytes reported by tmux, after transport decoding.
  • labelText function Decode a label as UTF-8, retaining byte access on failure.
  • linksForSession function A session's window links in window-index order, preserving repeated windows.
  • LookupError data type A reference that cannot resolve in the supplied immutable snapshot. Missing entities are distinct from a successfully observed empty relation.
  • lookupPane function Resolve the supplied generation's physical pane in this snapshot.
  • lookupSession function Resolve a session in this snapshot. Missing and foreign refs are errors.
  • lookupSessionId function Select the session currently observed under an ID in this snapshot. This creates no continuity guarantee with a previously opened Server.
  • lookupWindow function Resolve the supplied generation's physical window in this snapshot.
  • lookupWindowId function Select the physical window observed under an ID in this snapshot.
  • paneId function Native pane ID. Comparing IDs alone does not compare Server identity.
  • PaneOccurrence data type A physical pane together with one contextual window appearance.
  • paneOccurrences function Every pane appearance, ordered by link and then pane index.
  • panesForWindow function A physical window's panes in pane-index order, then numeric ID order.
  • serverInfo function Daemon metadata captured with this graph.
  • ServerInfo data type Reported daemon metadata within one adopted generation. PID and start time are observations; they do not grant signal authority or durable identity.
  • sessionId function Native session ID, without the reference's generation guarantee.
  • snapshotOrigin function Inspect provenance without contacting tmux. See LibTmux.Snapshot.Fixture for validated offline construction.
  • windowId function Native physical window ID. Window-link indices are separate values.
  • WindowLink data type One observed session*index*window binding. Indices are reusable positions; this value describes captured context. The same window may appear repeatedly.
  • windowLinks function Window appearances in session ID and window-index order.

Referenced by#

Guides#

Pages that discuss LibTmux.Snapshot.

Esc

Type to search.

Reference previewOpen reference