Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

function libtmux-elixir

Session.windows/2

Returns a selection 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

Description

Repeated links to a window contribute it once. For membership indexes use LibTmux.Snapshot.related/4 with :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 an empty selection. No I/O occurs. The selection retains the supplied snapshot for filtering; relationship predicates still validate their whole captured source domain. Use Enum.to_list/1 when only the list is needed.

Parameters

Examples

iex> alias LibTmux.{Selection, 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> {:ok, window} = Session.windows(snapshot, session) |> Selection.one()
iex> window.id
"@7"
iex> Session.panes(snapshot, session) |> Enum.map(& &1.id)
["%9"]
iex> Session.active_window(snapshot, session) == window
true

Recorded calls

source calls
No call edges in the Elixir model.

The Elixir reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux.Session.windows/2.

Guides

task material

Pages that discuss windows/2.

Esc
Search in

Type to search.

Reference previewOpen reference