# command-error

Source: https://libtmux.org/en/tmux/latest/catalog/hooks/command-error/

> Run when a command fails.

hook tmux3.7c

Run when a command fails.

* Scope

  session

* Set

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

* Read

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

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

Run when a command fails.

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

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

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

* Defined in

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

* Fired from

  * [`cmd-queue.c:676`](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-queue.c#L676) in `cmdq_insert_hook`

* C source reference

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

* CLI Manual

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

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

Library documentation that names this hook.

* Rust

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

* Go

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