# LibTmux.Session.active_window/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/entities.ex#L66
- **Page:** https://libtmux.org/en/elixir/latest/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()`)
