# tmux_hook:unset/2

- **Package:** libtmux_erlang
- **Language:** Erlang
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-erlang/blob/d1b6308440cf9eb8f6647e7ae434bce60e849368/apps/libtmux_erlang/src/tmux_hook.erl#L148
- **Page:** https://libtmux.org/en/erlang/latest/reference/tmux_hook-unset-2/

```
unset(Scope, Key)
-spec unset(scope(), tmux_option:key()) ->
               {ok, tmux_operation:completed()} |
               {error, tmux_operation:failure()}.
```

Remove one indexed entry or the whole local array. Removing an entry leaves its local array, possibly empty. Removing the whole array restores inheritance; unsetting a global builtin resets its native default. Missing local values are a successful native no-op. Performs I/O; queued hook effects are unaffected.

## Parameters

- `Scope` (`scope()`)
- `Key` (`tmux_option:key()`)

## tmux command

The tmux commands behind `unset/2`.

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