# client-session-changed

Source: https://libtmux.org/en/tmux/3.7c/catalog/hooks/client-session-changed/

> Run when a client's attached session is changed.

hook tmux3.7c

Run when a client's attached session is changed.

* Scope

  session

* Set

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

* Read

  [`show-hooks`](https://libtmux.org/en/tmux/3.7c/manual/show-hooks/) `client-session-changed`

* Control mode

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

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

Run when a client's attached session is changed.

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

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

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

* Defined in

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

* Fired from

  * [`server-client.c:425`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-client.c#L425) in `notify_client`

* C source reference

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

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/3.7c/manual/full/#hooks-client-session-changed)

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

Library documentation that names this hook.

* Rust

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

* Go

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