# window-unlinked

Source: https://libtmux.org/en/tmux/3.2a/catalog/hooks/window-unlinked/

> Run when a window is unlinked from a session.

hook tmux3.2a

Run when a window is unlinked from a session.

* Scope

  window

* Set

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

* Read

  [`show-hooks`](https://libtmux.org/en/tmux/3.2a/manual/show-hooks/) `window-unlinked`

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

Run when a window is unlinked from a session.

## Releases[#](https://libtmux.org/en/tmux/3.2a/catalog/hooks/window-unlinked/#releases)

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

## Source[#](https://libtmux.org/en/tmux/3.2a/catalog/hooks/window-unlinked/#source)

* Defined in

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

* Fired from

  * [`server-fn.c:271`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/server-fn.c#L271) in `notify_session_window`
  * [`session.c:223`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/session.c#L223) in `notify_session_window`
  * [`session.c:357`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/session.c#L357) in `notify_session_window`
  * [`session.c:687`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/session.c#L687) in `notify_session_window`
  * [`spawn.c:135`](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/spawn.c#L135) in `notify_session_window`

* C source reference

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

* CLI Manual

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

## Used by[#](https://libtmux.org/en/tmux/3.2a/catalog/hooks/window-unlinked/#used-by)

Library documentation that names this hook.

* Rust

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

* Go

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