# tmux_snapshot:related/3

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_snapshot.erl#L149
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_snapshot-related-3/

```
related/3
-spec related(atom(), tmux_model:row(), t()) ->
                 {ok,
                  [tmux_model:row()] |
                  tmux_model:row() |
                  none} |
                 {error, map()}.
```

Traverse a complete captured relationship without I/O. To-many relations return lists; to-one relations return a row or known absence. The input row must belong to this snapshot. Unloaded relations and mismatched rows return tagged errors.

## Parameters

- `Relation` (`atom()`)
- `Row` (`tmux_model:row()`)
- `Snapshot` (`t()`)

## Guides

Pages that discuss `related/3`.

- [Object graph](/en/erlang/latest/concepts/object-graph/)

## In other ports

List a session's windows

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.windows`](/en/py/latest/reference/libtmux-session-windows/) (property) |
| Ruby | [`LibTmux::Session#list_windows`](/en/ruby/latest/reference/libtmux-session-list_windows/) (method) |
| PowerShell | [`LibTmux\Get-TmuxWindow`](/en/powershell/latest/reference/libtmux-get-tmuxwindow/) (cmdlet). Use the [`-Session`](/en/powershell/latest/reference/libtmux-get-tmuxwindow/#LibTmux%5CGet-TmuxWindow.parameter.Session) parameter set to acquire placements in one session. |
| Julia | [`LibTmux.windows`](/en/julia/latest/reference/libtmux-windows/) (function). `windows` with a captured `SessionSnapshot` reads distinct physical windows in that session. Use `windowlinks` for placements. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| Common Lisp | [`libtmux:windows`](/en/lisp/latest/reference/libtmux-windows/) (function). `windows` traverses a captured session. Repeated links preserve their physical-window multiplicity. |
| TypeScript | [`session.Session.windows`](/en/ts/latest/reference/session-session-windows/) (method) |
| Rust | [`session.Session.windows`](/en/rs/latest/reference/session-session-windows/) (method) |
| Go | [`tmux.Session.Windows`](/en/go/latest/reference/tmux-session-windows/) (method) |
| Java | [`io.github.libtmux.Session.windows`](/en/java/latest/reference/io-github-libtmux-session-session-windows/) (method) |
| Clojure | [`libtmux.data/windows`](/en/clojure/latest/reference/libtmux-data-windows/) (function). Traverses one capture locally. It does not issue a list-windows command. |
| Kotlin | [`io.github.libtmux.kotlin.Session.windows`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-session-windows/) (property) |
| Scala | [`io.github.libtmux.scaladsl.Session.windows`](/en/scala/latest/reference/io-github-libtmux-scaladsl-session-windows/) (method) |
| C# | [`LibTmux.Session.Windows`](/en/csharp/latest/reference/libtmux-session-windows/) (property) |
| F# | [`LibTmux.FSharp.Session.windows`](/en/fsharp/latest/reference/libtmux-fsharp-session-windows/) (function). Builds a deferred window query from one `LibTmux.Session` and its server. `Query.list` acquires placements scoped to that session ID. |
| C++ | [`libtmux::Session::windows`](/en/cxx/latest/reference/libtmux-session-windows/) (method) |
| Swift | [`Snapshot.windows(of:)`](/en/swift/latest/reference/snapshot-windows(of-)/) (method) |
| OCaml | [`Libtmux.Session.windows`](/en/ocaml/latest/reference/libtmux-session-windows/) (function). Reads distinct captured global windows in this session. window_links preserves individual indexed placements. |
| Perl | Traverse Session::window_links and resolve each link’s window, preserving explicit session placement and multiplicity. |

No equivalent is recorded in Lua or Elixir.

List a window's panes

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Window.panes`](/en/py/latest/reference/libtmux-window-panes/) (property) |
| Ruby | [`LibTmux::Window#list_panes`](/en/ruby/latest/reference/libtmux-window-list_panes/) (method) |
| PowerShell | [`LibTmux\Get-TmuxPane`](/en/powershell/latest/reference/libtmux-get-tmuxpane/) (cmdlet). Use the [`-Window`](/en/powershell/latest/reference/libtmux-get-tmuxpane/#LibTmux%5CGet-TmuxPane.parameter.Window) parameter set to acquire panes in one window. |
| Julia | [`LibTmux.panes`](/en/julia/latest/reference/libtmux-panes/) (function). `panes` with a captured `WindowSnapshot` reads panes in that window; missing coverage is an error. |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| Common Lisp | [`libtmux:panes`](/en/lisp/latest/reference/libtmux-panes/) (function). `panes` traverses a captured window without contacting tmux. |
| TypeScript | [`window.Window.panes`](/en/ts/latest/reference/window-window-panes/) (method) |
| Rust | [`window.Window.panes`](/en/rs/latest/reference/window-window-panes/) (method) |
| Go | [`tmux.Window.Panes`](/en/go/latest/reference/tmux-window-panes/) (method) |
| Java | [`io.github.libtmux.Window.panes`](/en/java/latest/reference/io-github-libtmux-window-window-panes/) (method) |
| Clojure | [`libtmux.data/panes`](/en/clojure/latest/reference/libtmux-data-panes/) (function). Traverses one capture locally. It does not issue a list-panes command. |
| Kotlin | [`io.github.libtmux.kotlin.Window.panes`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-window-panes/) (property) |
| Scala | [`io.github.libtmux.scaladsl.Window.panes`](/en/scala/latest/reference/io-github-libtmux-scaladsl-window-panes/) (method) |
| C# | [`LibTmux.Window.Panes`](/en/csharp/latest/reference/libtmux-window-panes/) (property) |
| F# | [`LibTmux.FSharp.Window.panes`](/en/fsharp/latest/reference/libtmux-fsharp-window-panes/) (function). Builds a deferred pane query from one `LibTmux.Window` and its server. `Query.list` acquires panes scoped to that window ID. |
| C++ | [`libtmux::Window::panes`](/en/cxx/latest/reference/libtmux-window-panes/) (method) |
| Swift | [`Snapshot.panes(of:)`](/en/swift/latest/reference/snapshot-panes(of-)/) (method) |
| OCaml | [`Libtmux.Window.panes`](/en/ocaml/latest/reference/libtmux-window-panes/) (function). Reads captured panes in one global window without I/O. |
| Perl | [`LibTmux::Window::panes`](/en/perl/latest/reference/libtmux-window-panes/) (method). Reads this physical window’s captured panes without I/O. |

No equivalent is recorded in Lua or Elixir.
