# libtmux.Window:run_hook

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Lua
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-lua/blob/d68f829fe097e38dcbbf7147e276666fe615f0cf/lua/libtmux/_internal/entity.lua#L417
- **Inherited from:** libtmux.Configurable
- **Page:** https://libtmux.org/en/lua/v0.1.1/reference/libtmux-window-run_hook/

```
run_hook: fun(
  self: libtmux.Configurable<libtmux.SnapshotWindow>,
  name: string,
  options?: libtmux.RunHookOptions,
):libtmux.Request<boolean>
```

## Parameters

- `name` (`string`)
- `options` (`libtmux.RunHookOptions?`):  Running a hook reads only its handle's own scope.

## 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)
