Server.setHook
Bind a tmux command to a global hook.
Source and package
-
Description#
A hook holds a list of commands. Without
appendthis writes the whole list, so it replaces whatever the hook already ran.Examples#
await server.setHook("session-created", "display-message 'hello'");await server.setHook("session-created", "display-message 'and this'", { append: true });
tmux command#
The tmux commands behind setHook.
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#
Bind a command to a global hook
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Lua | libtmux |
| Rust | server |
| Go | no equivalent on Server |
| Java | reached through Server.hooks, whose Hooks carries the write |
| C# | reached through Server.Hooks, whose TmuxHooks carries the write |
| C++ | no equivalent on Server |
| Swift | Server |
No equivalent is recorded in Ruby, PowerShell, Julia, Elixir, Kotlin, Scala or F#.