aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2015-05-12 15:27:46 +0000
committernicm <nicm>2015-05-12 15:27:46 +0000
commite958db09a72c2308d3edc8384be02714eb068ae7 (patch)
treef2034da50604c6cfbd35486ffdba9f674d12f7fa
parentb833fabeb2334c44406bd54ff7cc804d20c546f6 (diff)
downloadrtmux-e958db09a72c2308d3edc8384be02714eb068ae7.tar.gz
rtmux-e958db09a72c2308d3edc8384be02714eb068ae7.tar.bz2
rtmux-e958db09a72c2308d3edc8384be02714eb068ae7.zip
Add bell-action "other" to pass through bells in all windows except the
current, suggested by Jan ONDREJ.
-rw-r--r--options-table.c2
-rw-r--r--server-window.c11
-rw-r--r--tmux.18
-rw-r--r--tmux.h1
4 files changed, 15 insertions, 7 deletions
diff --git a/options-table.c b/options-table.c
index 9869e14f..44d36dca 100644
--- a/options-table.c
+++ b/options-table.c
@@ -49,7 +49,7 @@ const char *options_table_status_position_list[] = {
"top", "bottom", NULL
};
const char *options_table_bell_action_list[] = {
- "none", "any", "current", NULL
+ "none", "any", "current", "other", NULL
};
/* Server options. */
diff --git a/server-window.c b/server-window.c
index 4385dd90..1b3938d3 100644
--- a/server-window.c
+++ b/server-window.c
@@ -77,13 +77,18 @@ server_window_check_bell(struct session *s, struct winlink *wl)
if (c->session != s || c->flags & CLIENT_CONTROL)
continue;
if (!visual) {
- if (c->session->curw->window == w || action == BELL_ANY)
+ if ((action == BELL_CURRENT &&
+ c->session->curw->window == w) ||
+ (action == BELL_OTHER &&
+ c->session->curw->window != w) ||
+ action == BELL_ANY)
tty_bell(&c->tty);
continue;
}
- if (c->session->curw->window == w)
+ if (action == BELL_CURRENT && c->session->curw->window == w)
status_message_set(c, "Bell in current window");
- else if (action == BELL_ANY)
+ else if (action == BELL_ANY || (action == BELL_OTHER &&
+ c->session->curw->window != w))
status_message_set(c, "Bell in window %d", wl->idx);
}
diff --git a/tmux.1 b/tmux.1
index 79dfa4b4..7d9c0dc8 100644
--- a/tmux.1
+++ b/tmux.1
@@ -2375,16 +2375,18 @@ Set the base index from which an unused index should be searched when a new
window is created.
The default is zero.
.It Xo Ic bell-action
-.Op Ic any | none | current
+.Op Ic any | none | current | other
.Xc
Set action on window bell.
.Ic any
means a bell in any window linked to a session causes a bell in the current
window of that session,
.Ic none
-means all bells are ignored and
+means all bells are ignored,
.Ic current
-means only bells in windows other than the current window are ignored.
+means only bells in windows other than the current window are ignored and
+.Ic other
+means bells in the current window are ignored but not those in other windows.
.It Xo Ic bell-on-alert
.Op Ic on | off
.Xc
diff --git a/tmux.h b/tmux.h
index ccbdb763..f7c44b20 100644
--- a/tmux.h
+++ b/tmux.h
@@ -75,6 +75,7 @@ extern char **environ;
#define BELL_NONE 0
#define BELL_ANY 1
#define BELL_CURRENT 2
+#define BELL_OTHER 3
/* Special key codes. */
#define KEYC_NONE 0xfff