tmuxtmuxCLI manual

Choose documentation 1

latest

tmux manual version

Latest (3.7c) 3.7c 3.2a
English

tmux commands

tmux set-hook

command tmux 3.7c

Without -R, sets (or with -u unsets) hook hook-name to command.

Syntax

tmux set-hook [-agpRuw] [-t target-pane] hook [command]

Behavior

Without -R, sets (or with -u unsets) hook hook-name to command. The flags are the same as for set-option.

With -R, run hook-name immediately.

Guides

C implementation

Internal declarations in tmux 3.7c:

Use from a library

These methods send set-hook. Each describes its own defaults, errors and execution model.

Library methods that send tmux set-hook, by scope
Language Methods
Python HooksMixin.run_hook HooksMixin.set_hook HooksMixin.set_hooks HooksMixin.unset_hook Pane.run_hook Pane.set_hook Pane.set_hooks Pane.unset_hook Server.run_hook Server.set_hook Server.set_hooks Server.unset_hook Session.run_hook Session.set_hook Session.set_hooks Session.unset_hook Window.run_hook Window.set_hook Window.set_hooks Window.unset_hook
Ruby Hooks#run Hooks#set Hooks#unset
Lua Pane:run_hook Pane:set_hook Pane:unset_hook Server:set_hook Server:unset_hook Session:run_hook Session:set_hook Session:unset_hook Window:run_hook Window:set_hook Window:unset_hook
PowerShell Set-TmuxHook
Julia set_hook unset_hook
Erlang run/2 unset/2
Haskell setHook setHookWith unsetHook unsetHookWith
Common Lisp client.set-hook client.unset-hook
TypeScript Pane.setHook Pane.unsetHook Server.setHook Server.unsetHook Session.setHook Session.unsetHook Window.setHook Window.unsetHook
Rust Pane.set_hook Pane.unset_hook Server.set_hook Server.set_hooks Server.unset_hook Session.set_hook Session.set_hooks Session.unset_hook Window.set_hook Window.set_hooks Window.unset_hook
Go GlobalSessionScope.AppendHook GlobalSessionScope.SetHook GlobalSessionScope.SetHooks GlobalSessionScope.UnsetHook GlobalWindowScope.AppendHook GlobalWindowScope.SetHook GlobalWindowScope.SetHooks GlobalWindowScope.UnsetHook Pane.AppendHook Pane.SetHook Pane.SetHooks Pane.UnsetHook Session.AppendHook Session.SetHook Session.SetHooks Session.UnsetHook Window.AppendHook Window.SetHook Window.SetHooks Window.UnsetHook
Java Hooks.append Hooks.run Hooks.set Hooks.unset
Clojure append-hook! set-hook! unset-hook!
Kotlin Hooks.`set` Hooks.append Hooks.run Hooks.unset
Scala Hooks.append Hooks.run Hooks.set Hooks.unset
C# TmuxHooks.SetAsync TmuxHooks.UnsetAsync
C++ Server::set_global_hook Session::set_hook
Swift Server.runHook(_:in:) Server.setHook(_:to:at:in:) Server.unsetHook(_:in:)
OCaml remove_hook remove_hook run_hook run_hook set_hook set_hook
Perl Async::Server::set_hook LibTmux::Server::set_hook
Raku Hooks.append Hooks.run Hooks.set Hooks.unset

No method in Elixir or F# sends this command itself.

tmux sources and license

Syntax comes from tmux 3.7c list-commands. See the global options for sockets and configuration, and command syntax and targets.

Behavior is taken from the tmux 3.7c manual.

Command declaration

Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Esc

Type to search.

Reference previewOpen reference