# Libtmux_eio.Client.run_hook

- **Module:** Libtmux_eio
- **Package:** libtmux-eio
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/eio/libtmux_eio.mli#L403
- **Public owner:** Libtmux_eio
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_eio-client-run_hook/

```
val run_hook :
  t -> Libtmux.Options.scope -> string -> (unit, Libtmux.Error.t) result
```

Run the effective hook in an explicit session, window or pane context. A successful result follows completion of its synchronous command queue. Background work started by a hook has its own lifetime. A later hook failure returns an uncertain outcome; preceding effects remain. Named `@` hooks return `Unsupported` because tmux can hide their parse failures in the server log. Configuration and inspection remain available.

## Parameters

- `arg1` (`t`)
- `arg2` (`Libtmux.Options.scope`)
- `arg3` (`string`)

## tmux command

The tmux commands behind `run_hook`.

- [`set-hook`](/en/tmux/latest/manual/set-hook/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_set_hook_entry`](/en/tmux/latest/reference/c-variable-cmd_set_hook_entry/) (attribute)
- [`cmd_set_option_exec`](/en/tmux/latest/reference/c-function-cmd-set-option-c-cmd_set_option_exec/) (function)
