# libtmux.Session.unset_hook

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/hooks.py#L198
- **Inherited from:** libtmux.hooks.HooksMixin
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-session-unset_hook/

tmux catalog: [Hooks](/en/tmux/latest/catalog/hooks/)

```
libtmux.Session.unset_hook(
    self,
    hook: str,
    global_: bool | None = None,
    scope: OptionScope
    | _DefaultOptionScope
    | None = DEFAULT_OPTION_SCOPE,
) -> Self
```

Unset hook for tmux target.

Wraps [`$ tmux set-hook -u <hook>`](/en/tmux/latest/manual/set-hook/) / [`$ tmux set-hook -U <hook>`](/en/tmux/latest/manual/set-hook/)

## Parameters

- `hook` (`str`): hook to unset, e.g. 'after-show-environment'
- `global_` (`bool | None`)
- `scope` (`OptionScope | _DefaultOptionScope | None`)

## Raises

- [`exc.OptionError`](/en/py/stable/reference/libtmux-exc-optionerror/)
- [`exc.UnknownOption`](/en/py/stable/reference/libtmux-exc-unknownoption/)
- [`exc.InvalidOption`](/en/py/stable/reference/libtmux-exc-invalidoption/)
- [`exc.AmbiguousOption`](/en/py/stable/reference/libtmux-exc-ambiguousoption/)

## In other ports

### Unbind a session hook

- Lua: [`libtmux.Session:unset_hook`](/en/lua/latest/reference/libtmux-session-unset_hook/) (method)
- TypeScript: [`session.Session.unsetHook`](/en/ts/latest/reference/session-session-unsethook/) (method)
- Rust: [`session.Session.unset_hook`](/en/rs/latest/reference/session-session-unset_hook/) (method)
- Go: [`tmux.Session.UnsetHook`](/en/go/latest/reference/tmux-session-unsethook/) (method)
- Swift: [`Server.unsetHook(_:in:)`](/en/swift/latest/reference/server-unsethook(_-in-)/) (method)
