# server.Server.showHooks

- **Module:** server
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/server.ts#L1121
- **Page:** https://libtmux.org/en/ts/latest/reference/server-server-showhooks/

```
showHooks(): Promise<
  ReadonlyMap<string, readonly string[]>
>
```

Every global hook tmux currently reports.

A hook is an array of commands, keyed by the name [`setHook`](/en/ts/latest/reference/server-server-sethook/) takes, so
what was set reads back under the name it was set with. tmux prints each
element as `name[0]`, which composes with neither of the writers.

## Examples

```ts
const hooks = await server.showHooks();
hooks.get("session-created")?.[0];
```

## tmux command

The tmux commands behind `showHooks`.

- [`show-hooks`](/en/tmux/latest/manual/show-hooks/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_show_hooks_entry`](/en/tmux/latest/reference/c-variable-cmd_show_hooks_entry/) (attribute)
- [`cmd_show_options_exec`](/en/tmux/latest/reference/c-function-cmd-show-options-c-cmd_show_options_exec/) (function)

## tmux hooks

Events that run tmux commands, with the scope each hook belongs to and where tmux fires it.

- [Hooks](/en/tmux/latest/catalog/hooks/) (hook)

## In other ports

Read the server's global hooks

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Server.show_hooks`](/en/py/latest/reference/libtmux-server-show_hooks/) (method) |
| Ruby | [`LibTmux::Server#hooks`](/en/ruby/latest/reference/libtmux-server-hooks/) (method) |
| Lua | [`libtmux.Server:list_hooks`](/en/lua/latest/reference/libtmux-server-list_hooks/) (method) |
| Rust | [`server.Server.hooks`](/en/rs/latest/reference/server-server-hooks/) (method) |
| Go | no equivalent on `Server` |
| Java | [`io.github.libtmux.Server.hooks`](/en/java/latest/reference/io-github-libtmux-server-server-hooks/) (method) |
| C# | [`LibTmux.Server.Hooks`](/en/csharp/latest/reference/libtmux-server-hooks/) (property) |
| C++ | [`libtmux::Server::hooks`](/en/cxx/latest/reference/libtmux-server-hooks/) (method) |
| Swift | [`Server.hooks(_:)`](/en/swift/latest/reference/server-hooks(_-)/) (method) |

No equivalent is recorded in PowerShell, Julia, Elixir, Kotlin, Scala or F#.
