# LibTmux.get_hook

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Julia
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/configuration.jl#L420
- **Page:** https://libtmux.org/en/julia/latest/reference/libtmux-get_hook/

```
get_hook(
    connection::LibTmux.ControlConnection,
    scope,
    name::AbstractString;
    inherit,
    kwargs...
)

get_hook(server::LibTmux.Server, scope, name::AbstractString; inherit, kwargs...)
```

## Methods

### `get_hook` (overload 1)

```julia
get_hook(
    connection::LibTmux.ControlConnection,
    scope,
    name::AbstractString;
    inherit,
    kwargs...
)
```

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/control_options.jl#L192).

Read the complete sparse hook array in tmux order without executing it. Return `nothing` for no local override, or an empty vector for a local empty array. Inherited entries carry `inherited=true`. Canonical command bodies and scope semantics follow the subprocess method; named replies and explicit parent lookups avoid raw broad listings and preserve empty-array masking.

```julia
get_hook(connection::ControlConnection, scope, name; inherit=false, kwargs...)
```

### `get_hook(server::LibTmux.Server, scope, name::AbstractString; inherit, kwargs...)`

[Source](https://github.com/libtmux/libtmux-julia/blob/f3da513be1225d36d5854cd8db5972c01857578e/src/configuration.jl#L430).

Return sparse `HookCommand` entries in tmux order. `nothing` means no local override; an empty vector means an explicitly empty command array. With `inherit=true`, include inherited hooks. Scopes follow `get_option`, excluding `:server`; only built-in hooks supported by the connected tmux are accepted. Command bodies use tmux's canonical executable grammar, not the original quoting or whitespace. This read does not execute the returned commands.

```julia
get_hook(server, scope, name; inherit=false, kwargs...)
```

## Parameters

- `connection` (`LibTmux.ControlConnection`) (for `get_hook(connection, scope, name, inherit, kwargs)`)
- `scope` (`Any`)
- `name` (`AbstractString`)
- `inherit` (`Bool`)
  Default: `false`.
- `kwargs`
- `server` (`LibTmux.Server`) (for `get_hook(server, scope, name, inherit, kwargs)`)
