=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.1,v retrieving revision 1.639 retrieving revision 1.640 diff -u -r1.639 -r1.640 --- src/usr.bin/tmux/tmux.1 2019/04/25 15:35:07 1.639 +++ src/usr.bin/tmux/tmux.1 2019/04/26 11:38:51 1.640 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.639 2019/04/25 15:35:07 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.640 2019/04/26 11:38:51 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 25 2019 $ +.Dd $Mdocdate: April 26 2019 $ .Dt TMUX 1 .Os .Sh NAME @@ -3383,7 +3383,7 @@ as Shift, Alt or Ctrl. .El .It Xo Ic show-options -.Op Fl gqsvw +.Op Fl gHqsvw .Op Fl t Ar target-session | Ar target-window .Op Ar option .Xc @@ -3415,6 +3415,8 @@ is set, no error will be returned if .Ar option is unset. +.Fl H +includes hooks (omitted by default). .It Xo Ic show-window-options .Op Fl gv .Op Fl t Ar target-window @@ -3439,6 +3441,26 @@ .Em after hook and there are a number of hooks not associated with commands. .Pp +Hooks are stored as array options, members of the array are executed in +order when the hook is triggered. +Hooks may be configured with the +.Ic set-hook +or +.Ic set-option +commands and displayed with +.Ic show-hooks +or +.Ic show-options +.Fl H . +The following two commands are equivalent: +.Bd -literal -offset indent. +set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red' +set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red' +.Ed +.Pp +Setting a hook without specifying an array index clears the hook and sets the +first member of the array. +.Pp A command's after hook is run after it completes, except when the command is run as part of a hook itself. @@ -3449,7 +3471,7 @@ layout after every .Ic split-window : .Bd -literal -offset indent -set-hook after-split-window "selectl even-vertical" +set-hook -g after-split-window "selectl even-vertical" .Ed .Pp All the notifications listed in the @@ -3513,7 +3535,7 @@ Hooks are managed with these commands: .Bl -tag -width Ds .It Xo Ic set-hook -.Op Fl gRu +.Op Fl agRu .Op Fl t Ar target-session .Ar hook-name .Ar command @@ -3535,6 +3557,8 @@ .Ar target-session with .Fl t ) . +.Fl a +appends to a hook. Like options, session hooks inherit from the global ones. .Pp With