# io.github.libtmux.Hooks.Hooks

- **Module:** io.github.libtmux.Hooks
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Hooks.java#L27
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-hooks-hooks/

The tmux hooks at one scope.

A hook binds a tmux command to an event, so tmux runs it without a client asking.

Every hook is an array: several commands can hang off one event, and tmux runs them in order.
That is why a listing answers with a list per event rather than a value — a hook set once is a
list of one, not a special case.

Each hook lives at a particular scope, and not every hook lives at every one.
{@code pane-focus-in} is a window hook, {@code alert-bell} a session hook. Setting one at a scope
it does not belong to is accepted and then silently discarded, on every supported release — so a
hook that never fires is worth checking against {@link #all()} before it is worth debugging.

## Members

- `global` (method)
- `session` (method)
- `window` (method)
- `pane` (method)
- `set` (method): Binds a tmux command to an event at this scope, replacing anything already bound to it.
- `append` (method): As {@link #append(String, String)}, with the command as words.
- `unset` (method): Removes everything bound to an event at this scope.
- `run` (method): Runs what is bound to an event now, without waiting for the event.
- `all` (method): Every hook at this scope, keyed by event, each with its commands in the order tmux runs them.
