Core Library0.xAPI reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

method libtmux

HooksMixin.show_hook

Return value for a hook.

Source and package
Qualified name
libtmux.hooks.HooksMixin.show_hook
Module
libtmux.hooks
Declared in
HooksMixin
Package
libtmux
Source
src/libtmux/hooks.py
show_hook ( self, hook: str, global_: bool = False, scope: OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE, ) → str | int | SparseArray[str] | None

Description

For array hooks (e.g., session-renamed), returns a SparseArray with hook values at their original indices. Use .keys() for indices and .values() for values.

Parameters
Returns

str | int | SparseArray[str] | None Hook value. For array hooks, returns SparseArray.

Raises

Examples

>>> session.set_hook('session-renamed[0]', 'display-message "test"')
Session($...)
>>> hooks = session.show_hook('session-renamed')
>>> isinstance(hooks, SparseArray)
True
>>> sorted(hooks.keys())
[0]
>>> session.unset_hook('session-renamed')
Session($...)

Same owner

containment 1 of 11 shown

Other members of libtmux.hooks.HooksMixin whose names share show_hook. They sit on the same type; that does not make them behave alike.

All 11 members of HooksMixin

Recorded calls

source calls
No call edges in the Python model.

The Python reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls libtmux.hooks.HooksMixin.show_hook.

tmux command

task material

The tmux commands behind show_hook.

tmux C API

task material

The C declarations in tmux that implement these commands.

tmux hooks

task material

Events that run tmux commands, with the scope each hook belongs to and where tmux fires it.

Esc
Search in

Type to search.

Reference previewOpen reference