# Server, session, window, pane

Source: https://libtmux.org/en/clojure/latest/concepts/server-session-window-pane/

> Traverse one captured graph and keep effects explicit through Java references.

[`open!`][open] returns a closeable Java server client for an explicit socket.
[`snapshot!`][snapshot] acquires a graph of persistent maps. A snapshot contains
sessions; sessions contain window placements; windows contain panes.
[`data/windows`][windows] and [`data/panes`][panes] traverse that capture
without another tmux command. Ordinary keyword lookup reads its scalar fields.

Maps retain an opaque Java handle at `:tmux/ref`. Pass that reference to an
effect such as [`rename!`][rename]. Editing an ID in a map changes the map;
it does not change the target authenticated by its reference. The old map
keeps its earlier name after a rename. [`refresh!`][refresh] acquires a new
observation.

A linked window can occur in several sessions. [`same-entity?`][entity]
compares physical identity; [`same-link?`][link] also compares its placement.
Keep input order and repeated placements when processing the graph.

Use native collection functions to filter captured values. When a Java
[`FilterExpr`](<https://libtmux.org/en/java/latest/reference/io-github-libtmux-query-filterexpr-filterexpr/>) already exists, [`matching`][matching] adapts it to a Clojure
transducer or lazy sequence. [`exactly-one`][one] checks cardinality before an
effect. [`data`][data] removes operational references for detached EDN export.

The [quickstart](https://libtmux.org/en/clojure/latest/) demonstrates these operations. The
[captured-value reference](https://libtmux.org/en/clojure/latest/guides/captured-values/) lists the keys;
[captures and effects](https://libtmux.org/en/clojure/latest/guides/captures-and-effects/) explains ownership,
lazy processing and recovery.

[open]: https://libtmux.org/en/clojure/latest/reference/libtmux-core-open/
[snapshot]: https://libtmux.org/en/clojure/latest/reference/libtmux-core-snapshot/
[windows]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-windows/
[panes]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-panes/
[rename]: https://libtmux.org/en/clojure/latest/reference/libtmux-core-rename/
[refresh]: https://libtmux.org/en/clojure/latest/reference/libtmux-core-refresh/
[entity]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-same-entity/
[link]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-same-link/
[matching]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-matching/
[one]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-exactly-one/
[data]: https://libtmux.org/en/clojure/latest/reference/libtmux-data-data/
