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
Server
Package
libtmux
Source
src/libtmux/hooks.py
Other languages
RubyLuaTypeScriptRust Go Java.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 the server's global 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 server.showHooks();
hooks.get("session-created")?.[0];
let guard = libtmux::test::TestServer::new().await?;
let server = guard.server();
server.set_hook("alert-bell", "display-message rang").await?;
let hooks = server.hooks().await?;
assert!(hooks.contains_key("alert-bell"));
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.