Server.show_hooks
Return a dict of hooks for the target.
Source and package
-
Inherited from
libtmux.hooks.HooksMixinExamples#
>>> session.set_hook('session-renamed[0]', 'display-message "test"')Session($...)>>> hooks = session.show_hooks()>>> isinstance(hooks, dict)True>>> 'session-renamed[0]' in hooksTrue>>> session.unset_hook('session-renamed')Session($...)- Parameters
-
-
global_(bool | None) # – Pass-gflag for global hooks, default False. -
scope(OptionScope | _DefaultOption | None) # – Hook scope (Server/Session/Window/Pane), defaults to object's scope.Scope
-
- Returns
-
HookDict Dictionary mapping hook names to their values.
tmux command#
The tmux commands behind show_hooks.
tmux C API#
The C declarations in tmux that implement these commands.
tmux hooks#
Events that run tmux commands, with the scope each hook belongs to and where tmux fires it.
In other ports#
Read the server's global hooks
| Language | Equivalent |
|---|---|
| Ruby | Lib |
| Lua | libtmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | server |
| Rust | server |
| Go | no equivalent on Server |
| Java | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux Pass the corresponding explicit Options scope; captured tables preserve their source and inheritance policy. |
| Perl | Lib Use global => true; raw bytes preserve sparse hook indexes and tmux quoting. |
No equivalent is recorded in PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.