Hooks in tmux

From the tmux cheat sheet ยท Formats and Automation ยท verified Aug 2026

Hooks

Run a tmux command after a server event.

bash
set-hook -g session-created 'display-message "Session created"'
๐Ÿ“Œ Hooks run tmux commands, not raw shell syntax
๐Ÿ’ก Use run-shell when a hook must call a script
๐Ÿ” Multiple hooks can use indexed array options
โš ๏ธ Keep hooks fast to avoid workflow delays
hooksautomationevents

Continue with tmux

Save the full cheat sheet or work through every related task.

More tmux tasks

Back to the full tmux cheat sheet