# LibTmux.Server.setHook

- **Package:** libtmux-haskell
- **Language:** Haskell
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-haskell/blob/72edb54317bf619c6dc54bff311844f062f8984c/src/LibTmux/Server.hs#L620
- **Page:** https://libtmux.org/en/haskell/latest/reference/libtmux-server-v-sethook/

```haskell
setHook
  :: Server
  -> OptionTarget
  -> Text
  -> Word32
  -> ByteString
  -> IO ()
```

Signature types: [`Server`](/en/haskell/latest/reference/libtmux-server-t-server/), [`OptionTarget`](/en/haskell/latest/reference/libtmux-options-t-optiontarget/), [`Text`](https://hackage.haskell.org/package/text-2.1.3/docs/Data-Text.html#t:Text), [`Word32`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Data-Word.html#t:Word32), [`ByteString`](https://hackage.haskell.org/package/bytestring-0.12.2.0/docs/Data-ByteString.html#t:ByteString), [`IO`](https://hackage.haskell.org/package/base-4.22.0.0/docs/Prelude.html#t:IO).

Set one numeric entry of a built-in event. The operand is tmux command
 source, parsed when the daemon registers it. Other indices stay in place.

## Referenced declarations

- [`LibTmux.Options.OptionTarget`](/en/haskell/latest/reference/libtmux-options-t-optiontarget/) (data type)
- [`LibTmux.Server.Server`](/en/haskell/latest/reference/libtmux-server-t-server/) (data type)

## tmux command

The tmux commands behind `setHook`.

- [`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)

## Guides

Pages that discuss `setHook`.

- [Read and change options and hooks](/en/haskell/latest/guides/options/)
- [Implementation status](/en/haskell/latest/guides/status/)
