# LibTmux.Snapshot

- **Package:** libtmux-haskell
- **Language:** Haskell
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-haskell/blob/663e212622a02aa74a9bdc8ff71e2b45fcb1d4d5/src/LibTmux/Snapshot.hs
- **Page:** https://libtmux.org/en/haskell/latest/reference/libtmux-snapshot/

Detached tmux observations and pure navigation.

[`LibTmux.Server`](/en/haskell/latest/reference/libtmux-server/) acquires a [`Snapshot`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-t-window/) and [`Pane`](/en/haskell/latest/reference/libtmux-snapshot-t-pane/) are physical entities. A [`WindowLink`](/en/haskell/latest/reference/libtmux-snapshot-t-windowlink/) identifies an
 observed session*index*window binding; [`PaneOccurrence`](/en/haskell/latest/reference/libtmux-snapshot-t-paneoccurrence/) retains that
 context. [`paneOccurrences`](/en/haskell/latest/reference/libtmux-snapshot-v-paneoccurrences/) therefore preserves repeated appearances while
 [`panes`](/en/haskell/latest/reference/libtmux-snapshot-v-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`](/en/haskell/latest/reference/libtmux-snapshot-v-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`](/en/haskell/latest/reference/libtmux-snapshot-fixture/) constructs validated offline snapshots;
 [`snapshotOrigin`](/en/haskell/latest/reference/libtmux-snapshot-v-snapshotorigin/) distinguishes them from observations acquired through IO.

# What is on here

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

**Complete observations**

[`Snapshot`](/en/haskell/latest/reference/libtmux-snapshot-t-snapshot/), [`ServerInfo`](/en/haskell/latest/reference/libtmux-snapshot-t-serverinfo/), [`SnapshotOrigin`](/en/haskell/latest/reference/libtmux-snapshot-t-snapshotorigin/), [`snapshotOrigin`](/en/haskell/latest/reference/libtmux-snapshot-v-snapshotorigin/), [`serverInfo`](/en/haskell/latest/reference/libtmux-snapshot-v-serverinfo-om0z/), [`captureInterval`](/en/haskell/latest/reference/libtmux-snapshot-v-captureinterval-190g/), [`CaptureInterval`](/en/haskell/latest/reference/libtmux-snapshot-t-captureinterval/)

**Physical and contextual values**

[`Session`](/en/haskell/latest/reference/libtmux-snapshot-t-session/), [`Window`](/en/haskell/latest/reference/libtmux-snapshot-t-window/), [`Pane`](/en/haskell/latest/reference/libtmux-snapshot-t-pane/), [`WindowLink`](/en/haskell/latest/reference/libtmux-snapshot-t-windowlink/), [`PaneOccurrence`](/en/haskell/latest/reference/libtmux-snapshot-t-paneoccurrence/), [`Client`](/en/haskell/latest/reference/libtmux-snapshot-t-client/), [`ClientAttachment`](/en/haskell/latest/reference/libtmux-snapshot-t-clientattachment/)

**Target identity**

[`Generation`](/en/haskell/latest/reference/libtmux-snapshot-t-generation/), [`SessionRef`](/en/haskell/latest/reference/libtmux-snapshot-t-sessionref/), [`WindowRef`](/en/haskell/latest/reference/libtmux-snapshot-t-windowref/), [`PaneRef`](/en/haskell/latest/reference/libtmux-snapshot-t-paneref/), [`sessionId`](/en/haskell/latest/reference/libtmux-snapshot-v-sessionid/), [`windowId`](/en/haskell/latest/reference/libtmux-snapshot-v-windowid/), [`paneId`](/en/haskell/latest/reference/libtmux-snapshot-v-paneid/)

**Ordered sources**

[`sessions`](/en/haskell/latest/reference/libtmux-snapshot-v-sessions/), [`windows`](/en/haskell/latest/reference/libtmux-snapshot-v-windows/), [`panes`](/en/haskell/latest/reference/libtmux-snapshot-v-panes/), [`windowLinks`](/en/haskell/latest/reference/libtmux-snapshot-v-windowlinks/), [`paneOccurrences`](/en/haskell/latest/reference/libtmux-snapshot-v-paneoccurrences/), [`clients`](/en/haskell/latest/reference/libtmux-snapshot-v-clients/)

**Indexed navigation**

[`LookupError`](/en/haskell/latest/reference/libtmux-snapshot-t-lookuperror/), [`lookupSession`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupsession/), [`lookupWindow`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupwindow/), [`lookupPane`](/en/haskell/latest/reference/libtmux-snapshot-v-lookuppane/), [`linksForSession`](/en/haskell/latest/reference/libtmux-snapshot-v-linksforsession/), [`panesForWindow`](/en/haskell/latest/reference/libtmux-snapshot-v-panesforwindow/), [`lookupSessionId`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupsessionid/), [`lookupWindowId`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupwindowid/), [`lookupPaneId`](/en/haskell/latest/reference/libtmux-snapshot-v-lookuppaneid/)

**Lossless labels**

[`TmuxText`](/en/haskell/latest/reference/libtmux-snapshot-t-tmuxtext/), [`labelFromBytes`](/en/haskell/latest/reference/libtmux-snapshot-v-labelfrombytes/), [`labelBytes`](/en/haskell/latest/reference/libtmux-snapshot-v-labelbytes/), [`labelText`](/en/haskell/latest/reference/libtmux-snapshot-v-labeltext/)

## Members

### Collections and queries

- [`sessions`](/en/haskell/latest/reference/libtmux-snapshot-v-sessions/) (function): Physical sessions in numeric ID order.
- [`windows`](/en/haskell/latest/reference/libtmux-snapshot-v-windows/) (function): Physical windows in numeric ID order, independent of their links.
- [`panes`](/en/haskell/latest/reference/libtmux-snapshot-v-panes/) (function): Physical panes in numeric ID order. Use :obj:`paneOccurrences <LibTmux.Snapshot#v:paneOccurrences>` for link context.
- [`clients`](/en/haskell/latest/reference/libtmux-snapshot-v-clients/) (function): Captured attached clients in reported-name and PID order. Names may repeat.

### Common operations

- [`Session`](/en/haskell/latest/reference/libtmux-snapshot-t-session/) (data type): Detached physical session. Navigate its appearances through :obj:`WindowLink <LibTmux.Snapshot#t:WindowLink>`.
- [`SessionRef`](/en/haskell/latest/reference/libtmux-snapshot-t-sessionref/) (data type): Session targeting identity within a :obj:`Generation <LibTmux.Snapshot#t:Generation>`. Compare observations
 separately when their captured field values matter.
- [`Window`](/en/haskell/latest/reference/libtmux-snapshot-t-window/) (data type): Detached physical window, independent of its session and index appearances.
- [`WindowRef`](/en/haskell/latest/reference/libtmux-snapshot-t-windowref/) (data type): Physical window targeting identity within a :obj:`Generation <LibTmux.Snapshot#t:Generation>`. A window can
 have several :obj:`WindowLink <LibTmux.Snapshot#t:WindowLink>` appearances.
- [`Pane`](/en/haskell/latest/reference/libtmux-snapshot-t-pane/) (data type): Detached physical pane. Its window can appear in several session contexts;
 :obj:`PaneOccurrence <LibTmux.Snapshot#t:PaneOccurrence>` preserves an appearance without duplicating physical identity.
- [`PaneRef`](/en/haskell/latest/reference/libtmux-snapshot-t-paneref/) (data type): Physical pane targeting identity within a :obj:`Generation <LibTmux.Snapshot#t:Generation>`. This carries
 identity, while the supplied :obj:`Snapshot <LibTmux.Snapshot#t:Snapshot>` determines the observed values.
- [`Snapshot`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-t-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 :obj:`LibTmux.Snapshot <LibTmux.Snapshot>`.
- [`labelFromBytes`](/en/haskell/latest/reference/libtmux-snapshot-v-labelfrombytes/) (function): Copy bytes into an owned label. This performs no encoding replacement.
- [`lookupPaneId`](/en/haskell/latest/reference/libtmux-snapshot-v-lookuppaneid/) (function): Select the pane observed under an ID in this snapshot.
- [`SnapshotOrigin`](/en/haskell/latest/reference/libtmux-snapshot-t-snapshotorigin/) (data type): Where the validated values were obtained. A server capture does not
 establish current liveness. Offline namespaces carry no targeting authority.

### Other members

- [`captureInterval`](/en/haskell/latest/reference/libtmux-snapshot-v-captureinterval-190g/) (function): Acquisition bounds attached to a live capture. An unstamped decoded
 profile stays private; an offline fixture has no external capture interval.
- [`CaptureInterval`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-t-generation/) (data type): Opaque connection or offline-fixture identity. Independent Server handles
 receive distinct tokens; named fixtures never equal an adopted endpoint.
- [`labelBytes`](/en/haskell/latest/reference/libtmux-snapshot-v-labelbytes/) (function): Exact bytes reported by tmux, after transport decoding.
- [`labelText`](/en/haskell/latest/reference/libtmux-snapshot-v-labeltext/) (function): Decode a label as UTF-8, retaining byte access on failure.
- [`linksForSession`](/en/haskell/latest/reference/libtmux-snapshot-v-linksforsession/) (function): A session's window links in window-index order, preserving repeated windows.
- [`LookupError`](/en/haskell/latest/reference/libtmux-snapshot-t-lookuperror/) (data type): A reference that cannot resolve in the supplied immutable snapshot.
 Missing entities are distinct from a successfully observed empty relation.
- [`lookupPane`](/en/haskell/latest/reference/libtmux-snapshot-v-lookuppane/) (function): Resolve the supplied generation's physical pane in this snapshot.
- [`lookupSession`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupsession/) (function): Resolve a session in this snapshot. Missing and foreign refs are errors.
- [`lookupSessionId`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupsessionid/) (function): Select the session currently observed under an ID in this snapshot.
 This creates no continuity guarantee with a previously opened Server.
- [`lookupWindow`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupwindow/) (function): Resolve the supplied generation's physical window in this snapshot.
- [`lookupWindowId`](/en/haskell/latest/reference/libtmux-snapshot-v-lookupwindowid/) (function): Select the physical window observed under an ID in this snapshot.
- [`paneId`](/en/haskell/latest/reference/libtmux-snapshot-v-paneid/) (function): Native pane ID. Comparing IDs alone does not compare Server identity.
- [`PaneOccurrence`](/en/haskell/latest/reference/libtmux-snapshot-t-paneoccurrence/) (data type): A physical pane together with one contextual window appearance.
- [`paneOccurrences`](/en/haskell/latest/reference/libtmux-snapshot-v-paneoccurrences/) (function): Every pane appearance, ordered by link and then pane index.
- [`panesForWindow`](/en/haskell/latest/reference/libtmux-snapshot-v-panesforwindow/) (function): A physical window's panes in pane-index order, then numeric ID order.
- [`serverInfo`](/en/haskell/latest/reference/libtmux-snapshot-v-serverinfo-om0z/) (function): Daemon metadata captured with this graph.
- [`ServerInfo`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-v-sessionid/) (function): Native session ID, without the reference's generation guarantee.
- [`snapshotOrigin`](/en/haskell/latest/reference/libtmux-snapshot-v-snapshotorigin/) (function): Inspect provenance without contacting tmux. See
 :obj:`LibTmux.Snapshot.Fixture <LibTmux.Snapshot.Fixture>` for validated offline construction.
- [`windowId`](/en/haskell/latest/reference/libtmux-snapshot-v-windowid/) (function): Native physical window ID. Window-link indices are separate values.
- [`WindowLink`](/en/haskell/latest/reference/libtmux-snapshot-t-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`](/en/haskell/latest/reference/libtmux-snapshot-v-windowlinks/) (function): Window appearances in session ID and window-index order.

## Referenced by

- [`LibTmux`](/en/haskell/latest/reference/libtmux/) (module)

## Guides

Pages that discuss `LibTmux.Snapshot`.

- [Implementation status](/en/haskell/latest/guides/status/)
