# 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/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/Hooks.java#L26
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-hooks-hooks/

The tmux hooks at one scope.

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

<p>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.

<p>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) — Binds another command to an event, after whatever is already bound to it.
- `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.
