Core LibraryunreleasedAPI Reference

Choose documentation 2

latest

Current version

latest
English

Unreleased libtmux has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-ocaml latest

Client.set_hook

Set a hook to a nonempty command list. Without an index, replace the whole hook array, or fill the lowest free index when appending. An explicit @name custom hook stores command text as a user option; it requires complete replacement and has no array indexes. read_hook returns its Libtmux.Options.Text value; bulk hook capture includes built-ins. Commands may cause arbitrary tmux effects when triggered. Hooks that print output are outside the supported control transport contract.

Source and package
Qualified name
Libtmux_eio.Client.set_hook
Module
Libtmux_eio
Declared in
Client
Package
libtmux-eio
Source
eio/libtmux_eio.mli
Other languages
Perlmethod Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby LuaTypeScriptRustGo Java C# C++Swift Kotlin Scala F# Clojure
val set_hook : ?index:int -> ?append:bool -> t -> Libtmux.Options.scope -> name:string -> Libtmux.Hook.command list -> (unit, Libtmux.Error.t) result

Public owner: Libtmux_eio

Parameters

tmux command#

The tmux commands behind set_hook.

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

Equivalents of Bind a command to a global hook in other languages
Language Equivalent
Python libtmux.Server.set_hook
Lua libtmux.Server:set_hook
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript server.Server.setHook
Rust server.Server.set_hook
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.setHook(_:to:at:in:)
Perl LibTmux::Server::set_hook Use global => true; command is an explicit native tmux command string.

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Bind a command to a session hook

Equivalents of Bind a command to a session hook in other languages
Language Equivalent
Python libtmux.Session.set_hook
Lua libtmux.Session:set_hook
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript session.Session.setHook
Rust session.Session.set_hook
Go tmux.Session.SetHook
Java reached through Session.hooks, whose Hooks carries the write
C# reached through Session.Hooks, whose TmuxHooks carries the write
C++ libtmux::Session::set_hook
Swift Server.setHook(_:to:at:in:)
Perl LibTmux::Server::set_hook Use an explicit session target ID; command is an explicit native tmux command string.

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Bind a command to a window hook

Equivalents of Bind a command to a window hook in other languages
Language Equivalent
Python libtmux.Window.set_hook
Lua libtmux.Window:set_hook
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript window.Window.setHook
Rust window.Window.set_hook
Go tmux.Window.SetHook
Java reached through Window.hooks, whose Hooks carries the write
C# reached through Window.Hooks, whose TmuxHooks carries the write
C++ no equivalent on Window
Swift Server.setHook(_:to:at:in:)
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Bind a command to a pane hook

Equivalents of Bind a command to a pane hook in other languages
Language Equivalent
Python libtmux.Pane.set_hook
Lua libtmux.Pane:set_hook
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript pane.Pane.setHook
Rust pane.Pane.set_hook
Go tmux.Pane.SetHook
Java reached through Pane.hooks, whose Hooks carries the write
C# reached through Pane.Hooks, whose TmuxHooks carries the write
C++ no equivalent on Pane
Swift Server.setHook(_:to:at:in:)
Perl No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands.

No equivalent is recorded in Ruby, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.

Esc

Type to search.

Reference previewOpen reference