# session-window-changed

Source: https://libtmux.org/en/tmux/latest/catalog/hooks/session-window-changed/

> The session with ID session-id changed its active window to the window with ID window-id.

hook tmux3.7c

The session with ID session-id changed its active window to the window with ID window-id.

* Scope

  session

* Set

  [`set-hook`](https://libtmux.org/en/tmux/latest/manual/set-hook/) `session-window-changed command`

* Read

  [`show-hooks`](https://libtmux.org/en/tmux/latest/manual/show-hooks/) `session-window-changed`

* Control mode

  Also sent to control clients as `%session-window-changed`

## Description[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-window-changed/#description)

The session with ID `session-id` changed its active window to the window with ID `window-id`.

This text describes the control mode notification `%session-window-changed`, which tmux sends when this hook fires.

## Releases[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-window-changed/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/hooks/session-window-changed/) : present
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/hooks/session-window-changed/) : present

## Source[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-window-changed/#source)

* Defined in

  [`options-table.c:1704`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/options-table.c#L1704)

* Fired from

  * [`session.c:496`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L496) in `notify_session`

* C source reference

  [`options_table`](https://libtmux.org/en/tmux/latest/reference/c-variable-options_table/), [`notify_session`](https://libtmux.org/en/tmux/latest/reference/c-function-notify_session/)

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/latest/manual/full/#control-mode-session-window-changed)

## Used by[#](https://libtmux.org/en/tmux/latest/catalog/hooks/session-window-changed/#used-by)

Library documentation that names this hook.

* Rust

  [`options.generated.SESSION_WINDOW_CHANGED`](https://libtmux.org/en/rs/latest/reference/options-generated-session_window_changed/)

* Go

  [`tmux.ServerHookValues.SessionWindowChanged`](https://libtmux.org/en/go/latest/reference/tmux-serverhookvalues-sessionwindowchanged/), [`tmux.SessionHookValues.SessionWindowChanged`](https://libtmux.org/en/go/latest/reference/tmux-sessionhookvalues-sessionwindowchanged/)
