summaryrefslogtreecommitdiffstats
path: root/tmux.1
diff options
context:
space:
mode:
authornicm <nicm>2016-04-29 14:05:24 +0000
committernicm <nicm>2016-04-29 14:05:24 +0000
commit0d84fdd95303a6ed4dcd761425e35f3731b86725 (patch)
tree3c1c65d16677c6b7aa579c8bf6500331ec08db47 /tmux.1
parentc5443da2d3bd5ef2464cc59941e55890aaff3fb0 (diff)
Final parts of command hooks, add before- and after- hooks to each command.
Diffstat (limited to 'tmux.1')
-rw-r--r--tmux.133
1 files changed, 30 insertions, 3 deletions
diff --git a/tmux.1 b/tmux.1
index d2bfe32b..0aeefc32 100644
--- a/tmux.1
+++ b/tmux.1
@@ -3221,9 +3221,35 @@ shows only the option value, not the name.
.Nm
allows commands to run on various triggers, called
.Em hooks .
-Each hook has a
-.Em name .
-The following hooks are available:
+Each
+.Nm
+command has a
+.Em before
+hook and an
+.Em after
+hook and there are a number of hooks not associated with commands.
+.Pp
+A command's before hook is run before the command is executed and its after
+hook is run afterwards, except when the command is run as part of a hook
+itself.
+Before hooks are named using the
+.Ql before-
+prefix and after hooks the
+.Ql after-
+prefix.
+For example, the following command adds a hook to select the even-vertical
+layout after every
+.Ic split-window :
+.Bd -literal -offset indent
+set-hook after-split-window "selectl even-vertical"
+.Ed
+.Pp
+Or to write when each new window is created to a file:
+.Bd -literal -offset indent
+set-hook before-new-window 'run "date >>/tmp/log"'
+.Ed
+.Pp
+In addition, the following hooks are available:
.Bl -tag -width "XXXXXXXXXXXXXXXX"
.It alert-activity
Run when a window has activity.
@@ -3450,6 +3476,7 @@ The following variables are available, where appropriate:
.It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
.It Li "client_utf8" Ta "" Ta "1 if client supports utf8"
.It Li "client_width" Ta "" Ta "Width of client"
+.It Li "command_hooked" Ta "" Ta "Name of command hooked, if any"
.It Li "command_name" Ta "" Ta "Name of command in use, if any"
.It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
.It Li "cursor_x" Ta "" Ta "Cursor X position in pane"