diff options
author | nicm <nicm> | 2016-10-13 22:48:51 +0000 |
---|---|---|
committer | nicm <nicm> | 2016-10-13 22:48:51 +0000 |
commit | 4289a1ebfa7479413ec5ac543b88c4ea039d00a0 (patch) | |
tree | d17862b06b8822aa1b8ab91d83e51a47e25e60e3 /tmux.1 | |
parent | 7a1a01feeff7b2ab17e2caef2d6b2180a8c1e70e (diff) | |
download | rtmux-4289a1ebfa7479413ec5ac543b88c4ea039d00a0.tar.gz rtmux-4289a1ebfa7479413ec5ac543b88c4ea039d00a0.tar.bz2 rtmux-4289a1ebfa7479413ec5ac543b88c4ea039d00a0.zip |
Trying to do hooks generically is way too complicated and unreliable and
confusing, particularly trying to automatically figure out what target
hooks should be using. So simplify it:
- drop before hooks entirely, they don't seem to be very useful;
- commands with special requirements now fire their own after hook (for
example, if they change session or window, or if they have -t and -s
and need to choose which one the hook uses as current target);
- commands with no special requirements can have the CMD_AFTERHOOK flag
added and they will use the -t state.
At the moment new-session, new-window, split-window fire their own hook,
and display-message uses the flag. The remaining commands still need to
be looked at.
Diffstat (limited to 'tmux.1')
-rw-r--r-- | tmux.1 | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -3204,20 +3204,16 @@ shows only the option value, not the name. .Nm allows commands to run on various triggers, called .Em hooks . -Each +Most .Nm -command has a -.Em before -hook and an +commands have 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 +A command's after +hook is run after it completes, 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 +They are named with an .Ql after- prefix. For example, the following command adds a hook to select the even-vertical @@ -3227,11 +3223,6 @@ layout after every 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 |