Session.windows/2
Returns a plain list of captured physical windows in first-link order.
Source and package
- Qualified name
-
LibTmux .Session .windows/2 - Module
- LibTmux
- Declared in
- Session
- Package
- libtmux
- Source
- lib/libtmux/entities.ex
- windows(snapshot, session) @spec windows(Lib
Tmux (), t()) :: [ Lib.Snapshot .t Tmux () ].Window .t -
Description#
Repeated links to a window contribute it once. For membership indexes use
LibTmux.Snapshot.related/4with:window_links.The supplied snapshot owns all returned fields and relationships. Only the session's ID and incarnation are used; its other fields may be older. Invalid or stale identities and missing source/relationship coverage raise
LibTmux.Error. A covered empty relation returns[]. No I/O occurs.Examples#
iex> alias LibTmux.{Session, Snapshot}iex> rows = %{session: [%{id: "$0"}], window: [%{id: "@7"}],...> window_link: [%{session_id: "$0", window_id: "@7", index: 0, active: true},...> %{session_id: "$0", window_id: "@7", index: 3, active: false}],...> pane: [%{id: "%9", window_id: "@7"}]}iex> {:ok, snapshot} = Snapshot.new(rows,...> server_instance: "example", captured_from: 0, captured_until: 0,...> complete: [:window_link, :pane],...> fields: %{window_link: [:session_id, :window_id, :active], pane: [:window_id]})iex> {:ok, session} = Snapshot.fetch(snapshot, :session, "$0")iex> [window] = Session.windows(snapshot, session)iex> window.id"@7"iex> Session.panes(snapshot, session) |> Enum.map(& &1.id)["%9"]iex> Session.active_window(snapshot, session) == windowtrueDiscussed in Captured tmux state