# client-session-changed

Source: https://libtmux.org/en/tmux/3.2a/catalog/hooks/client-session-changed/

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

hook tmux3.2a

Run when a client's attached session is changed.

* Scope

  session

* Set

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

* Read

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

* Control mode

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

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

Run when a client's attached session is changed.

## Releases[#](https://libtmux.org/en/tmux/3.2a/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.2a/catalog/hooks/client-session-changed/#source)

* Defined in

  [`options-table.c:1136`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/options-table.c#L1136)

* Fired from

  * [`cmd-attach-session.c:132`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-attach-session.c#L132) in `notify_client`
  * [`cmd-attach-session.c:163`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-attach-session.c#L163) in `notify_client`
  * [`cmd-new-session.c:325`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-new-session.c#L325) in `notify_client`
  * [`cmd-switch-client.c:144`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/cmd-switch-client.c#L144) in `notify_client`
  * [`server-fn.c:458`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-fn.c#L458) in `notify_client`

* C source reference

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

* CLI Manual

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

## Used by[#](https://libtmux.org/en/tmux/3.2a/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/)
