summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-08-17 08:37:38 +0000
committernicm <nicm@openbsd.org>2017-08-17 08:37:38 +0000
commit9a48cd7df8c7c97f19e39384cff0f58196fb0ab0 (patch)
treedfe38454999ad1ead2aea33796094a03ab538357
parentHonor TMPDIR if it is set to prevent erroring in some setup. (diff)
downloadwireguard-openbsd-9a48cd7df8c7c97f19e39384cff0f58196fb0ab0.tar.xz
wireguard-openbsd-9a48cd7df8c7c97f19e39384cff0f58196fb0ab0.zip
Add monitor-bell window option to match the activity and silence
options, from Brad Town.
-rw-r--r--usr.bin/tmux/alerts.c10
-rw-r--r--usr.bin/tmux/options-table.c8
-rw-r--r--usr.bin/tmux/tmux.124
3 files changed, 32 insertions, 10 deletions
diff --git a/usr.bin/tmux/alerts.c b/usr.bin/tmux/alerts.c
index 2513966e570..af7d81d4411 100644
--- a/usr.bin/tmux/alerts.c
+++ b/usr.bin/tmux/alerts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alerts.c,v 1.23 2017/08/16 11:46:08 nicm Exp $ */
+/* $OpenBSD: alerts.c,v 1.24 2017/08/17 08:37:38 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -90,8 +90,10 @@ alerts_check_session(struct session *s)
static int
alerts_enabled(struct window *w, int flags)
{
- if (flags & WINDOW_BELL)
- return (1);
+ if (flags & WINDOW_BELL) {
+ if (options_get_number(w->options, "monitor-bell"))
+ return (1);
+ }
if (flags & WINDOW_ACTIVITY) {
if (options_get_number(w->options, "monitor-activity"))
return (1);
@@ -164,6 +166,8 @@ alerts_check_bell(struct window *w)
if (~w->flags & WINDOW_BELL)
return (0);
+ if (!options_get_number(w->options, "monitor-bell"))
+ return (0);
TAILQ_FOREACH(wl, &w->winlinks, wentry)
wl->session->flags &= ~SESSION_ALERTED;
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index bf2708c18fc..bbfe6f665ec 100644
--- a/usr.bin/tmux/options-table.c
+++ b/usr.bin/tmux/options-table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.92 2017/08/16 11:46:08 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.93 2017/08/17 08:37:38 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -655,6 +655,12 @@ const struct options_table_entry options_table[] = {
.default_num = 0
},
+ { .name = "monitor-bell",
+ .type = OPTIONS_TABLE_FLAG,
+ .scope = OPTIONS_TABLE_WINDOW,
+ .default_num = 1
+ },
+
{ .name = "monitor-silence",
.type = OPTIONS_TABLE_NUMBER,
.scope = OPTIONS_TABLE_WINDOW,
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 3819575d6c4..c18b4c0c794 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.573 2017/08/16 12:12:54 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.574 2017/08/17 08:37:38 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -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: August 16 2017 $
+.Dd $Mdocdate: August 17 2017 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -2563,7 +2563,9 @@ The default is zero.
.It Xo Ic bell-action
.Op Ic any | none | current | other
.Xc
-Set action on window bell.
+Set action on a bell in a window when
+.Ic monitor-bell
+is on.
The values are the same as those for
.Ic activity-action .
.It Ic default-command Ar shell-command
@@ -2924,7 +2926,9 @@ If set to both, a bell and a message are produced.
.It Xo Ic visual-bell
.Op Ic on | off | both
.Xc
-If on, a message is shown on a bell instead of it being passed through to the
+If on, a message is shown on a bell in a window for which the
+.Ic monitor-bell
+window option is enabled instead of it being passed through to the
terminal (which normally makes a sound).
If set to both, a bell and a message are produced.
Also see the
@@ -3082,6 +3086,12 @@ option.
Monitor for activity in the window.
Windows with activity are highlighted in the status line.
.Pp
+.It Xo Ic monitor-bell
+.Op Ic on | off
+.Xc
+Monitor for a bell in the window.
+Windows with a bell are highlighted in the status line.
+.Pp
.It Xo Ic monitor-silence
.Op Ic interval
.Xc
@@ -3315,6 +3325,8 @@ See
.Ic monitor-activity .
.It alert-bell
Run when a window has received a bell.
+See
+.Ic monitor-bell .
.It alert-silence
Run when a window has been silent.
See
@@ -3845,8 +3857,8 @@ The flag is one of the following symbols appended to the window name:
.It Sy "Symbol" Ta Sy "Meaning"
.It Li "*" Ta "Denotes the current window."
.It Li "-" Ta "Marks the last window (previously selected)."
-.It Li "#" Ta "Window is monitored and activity has been detected."
-.It Li "\&!" Ta "A bell has occurred in the window."
+.It Li "#" Ta "Window activity is monitored and activity has been detected."
+.It Li "\&!" Ta "Window bells are monitored and a bell has occurred in the window."
.It Li "~" Ta "The window has been silent for the monitor-silence interval."
.It Li "M" Ta "The window contains the marked pane."
.It Li "Z" Ta "The window's active pane is zoomed."