Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

View as Markdown

Module
libtmux
Declared in
Session
Package
libtmux
Source
src/libtmux/hooks.py
Other languages
RubyLuaTypeScriptRustGoJava.NETC++Swift
show_hooks ( self , global_ : bool | None = False , scope : OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE ) → HookDict
method [source]
method [source]
show_hooks

Inherited from libtmux.hooks.HooksMixin

Return a dict of hooks for the target.

Parameters
Returns

HookDict Dictionary mapping hook names to their values.

In other ports Read a session's hooks

Examples

>>> session.set_hook('session-renamed[0]', 'display-message "test"')
Session($...)
>>> hooks = session.show_hooks()
>>> isinstance(hooks, dict)
True
>>> 'session-renamed[0]' in hooks
True
>>> session.unset_hook('session-renamed')
Session($...)
const hooks = await session.showHooks();
hooks.get("window-linked")?.[0];
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("hooked").await?;
session.set_hook("alert-bell", "display-message rang").await?;
let hooks = session.hooks().await?;
assert!(hooks.contains_key("alert-bell"));
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.