# window-unlinked

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

> Run when a window is unlinked from a session.

hook tmux3.7c

Run when a window is unlinked from a session.

* Scope

  session

* Set

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

* Read

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

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

Run when a window is unlinked from a session.

## Releases[#](https://libtmux.org/en/tmux/latest/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/latest/catalog/hooks/window-unlinked/#source)

* Defined in

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

* Fired from

  * [`server-fn.c:275`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L275) in `notify_session_window`
  * [`session.c:222`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L222) in `notify_session_window`
  * [`session.c:349`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L349) in `notify_session_window`
  * [`session.c:686`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/session.c#L686) in `notify_session_window`
  * [`spawn.c:134`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/spawn.c#L134) in `notify_session_window`

* C source reference

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

* CLI Manual

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

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