# remain-on-exit

Source: https://libtmux.org/en/tmux/3.7c/catalog/options/remain-on-exit/

> A pane with this flag set is not destroyed when the program running in it exits.

option tmux3.7c

A pane with this flag set is not destroyed when the program running in it exits.

* Scope

  window, pane

* Type

  Choice

* Default

  `off`

* Values

  `off` `on` `failed` `key`

* Set

  [`set-option`](https://libtmux.org/en/tmux/3.7c/manual/set-option/) `-w remain-on-exit value`

* Read

  [`show-options`](https://libtmux.org/en/tmux/3.7c/manual/show-options/) `-w remain-on-exit`

## Description[#](https://libtmux.org/en/tmux/3.7c/catalog/options/remain-on-exit/#description)

A pane with this flag set is not destroyed when the program running in it exits. If set to `failed`, then only when the program exit status is not zero. If set to `key`, the pane stays open and closes when a key is pressed. The pane may be reactivated with the [`respawn-pane`](https://libtmux.org/en/tmux/3.7c/manual/respawn-pane/) command.

## Releases[#](https://libtmux.org/en/tmux/3.7c/catalog/options/remain-on-exit/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/options/remain-on-exit/) : values off, on, failed to off, on, failed, key
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/options/remain-on-exit/) : present

## Source[#](https://libtmux.org/en/tmux/3.7c/catalog/options/remain-on-exit/#source)

* Defined in

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

* C source reference

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

* CLI Manual

  [Original manual entry](https://libtmux.org/en/tmux/3.7c/manual/full/#options-remain-on-exit)

## Used by[#](https://libtmux.org/en/tmux/3.7c/catalog/options/remain-on-exit/#used-by)

Library documentation that names this option.

* TypeScript

  [`server.Server.showGlobalOptions`](https://libtmux.org/en/ts/latest/reference/server-server-showglobaloptions/), [`types.NewSessionOptions.shellCommand`](https://libtmux.org/en/ts/latest/reference/types-newsessionoptions-shellcommand/), [`types.NewWindowOptions.shellCommand`](https://libtmux.org/en/ts/latest/reference/types-newwindowoptions-shellcommand/), [`types.SplitOptions.shellCommand`](https://libtmux.org/en/ts/latest/reference/types-splitoptions-shellcommand/)

* Rust

  [`options.generated.REMAIN_ON_EXIT`](https://libtmux.org/en/rs/latest/reference/options-generated-remain_on_exit/), [`options.OptionSchema.scopes`](https://libtmux.org/en/rs/latest/reference/options-optionschema-scopes/), [`pane.Pane.is_dead`](https://libtmux.org/en/rs/latest/reference/pane-pane-is_dead/), [`pane.Pane.pid`](https://libtmux.org/en/rs/latest/reference/pane-pane-pid/)

* Go

  [`tmux.GlobalWindowScope.SetRemainOnExit`](https://libtmux.org/en/go/latest/reference/tmux-globalwindowscope-setremainonexit/), [`tmux.Pane.SetRemainOnExit`](https://libtmux.org/en/go/latest/reference/tmux-pane-setremainonexit/), [`tmux.PaneOptionValues.RemainOnExit`](https://libtmux.org/en/go/latest/reference/tmux-paneoptionvalues-remainonexit/), [`tmux.RemainOnExit`](https://libtmux.org/en/go/latest/reference/tmux-remainonexit/), [`tmux.Window.SetRemainOnExit`](https://libtmux.org/en/go/latest/reference/tmux-window-setremainonexit/), [`tmux.WindowOptionValues.RemainOnExit`](https://libtmux.org/en/go/latest/reference/tmux-windowoptionvalues-remainonexit/)

* Java

  [`io.github.libtmux.Pane.dead`](https://libtmux.org/en/java/latest/reference/io-github-libtmux-pane-pane-dead/)

* C#

  [`LibTmux.Pane.Dead`](https://libtmux.org/en/csharp/latest/reference/libtmux-pane-dead/), [`LibTmux.PaneObservation.WatchAsync`](https://libtmux.org/en/csharp/latest/reference/libtmux-paneobservation-watchasync/)

* C++

  [`libtmux::Pane::dead`](https://libtmux.org/en/cxx/latest/reference/libtmux-pane-dead-9qv2/), [`libtmux::Pane::exit_status`](https://libtmux.org/en/cxx/latest/reference/libtmux-pane-exit_status-zax2/)

* F#

  [`LibTmux.FSharp.Control.watchPane`](https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-control-watchpane/)
