# LibTmux.Session.active_window/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/entities.ex#L119
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-session-active_window-2/

```
active_window(snapshot, session)
@spec active_window(LibTmux.Snapshot.t(), t()) ::
        LibTmux.Window.t() | nil
```

Returns the captured active physical window, or `nil` when none is active.

Multiple active links raise `LibTmux.Error`, even when they name the same
window. Unrelated sessions do not affect this lookup. Identity, coverage
and no-I/O behavior follow `windows/2`, which includes a worked example.

## Parameters

- `snapshot` (`LibTmux.Snapshot.t()`)
- `session` (`t()`)

## Guides

Pages that discuss `active_window/2`.

### Concepts

- [Captured tmux state](/en/elixir/pr-173/concepts/observations/)

### Guides

- [Filter captured values](/en/elixir/pr-173/guides/filtering/)

### Topics

- [Observation and filter schema](/en/elixir/pr-173/topics/schema/)
