libtmux Reference MCP Search
On this page

Server.setHook(_:to:at:in:)

View as Markdown

Declared in
Server
Package
libtmux-swift
Source
Sources/LibTmux/Options.swift
setHook(_:to:at:in:) ( name : String , to : String , at : Int? , in : HookScope ) TmuxReply
methodasync [source]
methodasync [source]
setHook(_:to:at:in:)

Binds a command to a hook.

Without an index this replaces every command bound to the name, leaving the one given at slot 0 — tmux assigns the array, not just an element. Pass at: to write one slot and leave its neighbours alone.

A name tmux does not know is a reply reporting why, not a thrown error.

  • Parameters:
    • name: a hook name tmux knows, such as after-new-window.
    • command: the tmux command line to run, unparsed until tmux runs it.
    • index: which slot to write, or every slot when omitted.
    • scope: which table to write to.
Raises

Discussed in Options and hooks

0 declared, 0 inherited

Esc

Type to search.