# pane-exited

Source: https://libtmux.org/en/tmux/latest/catalog/hooks/pane-exited/

> Run when the program running in a pane exits.

hook tmux3.7c

Run when the program running in a pane exits.

* Scope

  window, pane

* Set

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

* Read

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

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

Run when the program running in a pane exits.

## Releases[#](https://libtmux.org/en/tmux/latest/catalog/hooks/pane-exited/#releases)

* [tmux 3.7c](https://libtmux.org/en/tmux/3.7c/catalog/hooks/pane-exited/) : present
* [tmux 3.2a](https://libtmux.org/en/tmux/3.2a/catalog/hooks/pane-exited/) : present

## Source[#](https://libtmux.org/en/tmux/latest/catalog/hooks/pane-exited/#source)

* Defined in

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

* Fired from

  * [`server-fn.c:377`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L377) in `notify_pane`

* C source reference

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

* CLI Manual

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

## Used by[#](https://libtmux.org/en/tmux/latest/catalog/hooks/pane-exited/#used-by)

Library documentation that names this hook.

* Python

  [`libtmux_mcp.tools.hook_tools.show_hook`](https://libtmux.org/en/py/latest/mcp/reference/libtmux_mcp-tools-hook_tools-show_hook/)

* Rust

  [`mcp.views.Hook.name`](https://libtmux.org/en/rs/latest/mcp/reference/mcp-views-hook-name/), [`options.generated.PANE_EXITED`](https://libtmux.org/en/rs/latest/reference/options-generated-pane_exited/)

* Go

  [`tmux.PaneHookValues.PaneExited`](https://libtmux.org/en/go/latest/reference/tmux-panehookvalues-paneexited/), [`tmux.WindowHookValues.PaneExited`](https://libtmux.org/en/go/latest/reference/tmux-windowhookvalues-paneexited/)

* C#

  [`LibTmux.Mcp.HookEntry`](https://libtmux.org/en/csharp/latest/mcp/reference/libtmux-mcp-hookentry/), [`LibTmux.Mcp.HookEntry.Name`](https://libtmux.org/en/csharp/latest/mcp/reference/libtmux-mcp-hookentry-name/)
