Add bell-action "other" to pass through bells in all windows except the

current, suggested by Jan ONDREJ.
pull/1/head
nicm 2015-05-12 15:27:46 +00:00
parent b833fabeb2
commit e958db09a7
4 changed files with 15 additions and 7 deletions

View File

@ -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. */

View File

@ -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);
}

8
tmux.1
View File

@ -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

1
tmux.h
View File

@ -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