# destroy-unattached

Source: https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/

> If on, destroy the session after the last client has detached.

option tmux3.7c

If on, destroy the session after the last client has detached.

* Scope

  session

* Type

  Choice

* Default

  `off`

* Values

  `off` `on` `keep-last` `keep-group`

* Set

  [`set-option`](https://libtmux.org/en/tmux/latest/manual/set-option/) `destroy-unattached value`

* Read

  [`show-options`](https://libtmux.org/en/tmux/latest/manual/show-options/) `destroy-unattached`

## Description[#](https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/#description)

If `on`, destroy the session after the last client has detached. If `off` (the default), leave the session orphaned. If `keep-last`, destroy the session only if it is in a group and has other sessions in that group. If `keep-group`, destroy the session unless it is in a group and is the only session in that group.

## Releases[#](https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/options/destroy-unattached/) : type flag to choice; values now off, on, keep-last, keep-group
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/options/destroy-unattached/) : present

## Source[#](https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/#source)

* Defined in

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

* C source reference

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

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/latest/manual/full/#options-destroy-unattached)

## Used by[#](https://libtmux.org/en/tmux/latest/catalog/options/destroy-unattached/#used-by)

Library documentation that names this option.

* Rust

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

* Go

  [`tmux.Connection`](https://libtmux.org/en/go/latest/reference/tmux-connection/), [`tmux.DestroyUnattached`](https://libtmux.org/en/go/latest/reference/tmux-destroyunattached/), [`tmux.GlobalSessionScope.SetDestroyUnattached`](https://libtmux.org/en/go/latest/reference/tmux-globalsessionscope-setdestroyunattached/), [`tmux.Session.SetDestroyUnattached`](https://libtmux.org/en/go/latest/reference/tmux-session-setdestroyunattached/), [`tmux.SessionOptionValues.DestroyUnattached`](https://libtmux.org/en/go/latest/reference/tmux-sessionoptionvalues-destroyunattached/)

* C#

  [`LibTmux.Session.HoldWaitClientAsync`](https://libtmux.org/en/csharp/latest/reference/libtmux-session-holdwaitclientasync/)
