mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 00:23:08 +01:00
Add bell-action "other" to pass through bells in all windows except the
current, suggested by Jan ONDREJ.
This commit is contained in:
parent
b833fabeb2
commit
e958db09a7
@ -49,7 +49,7 @@ const char *options_table_status_position_list[] = {
|
|||||||
"top", "bottom", NULL
|
"top", "bottom", NULL
|
||||||
};
|
};
|
||||||
const char *options_table_bell_action_list[] = {
|
const char *options_table_bell_action_list[] = {
|
||||||
"none", "any", "current", NULL
|
"none", "any", "current", "other", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Server options. */
|
/* Server options. */
|
||||||
|
@ -77,13 +77,18 @@ server_window_check_bell(struct session *s, struct winlink *wl)
|
|||||||
if (c->session != s || c->flags & CLIENT_CONTROL)
|
if (c->session != s || c->flags & CLIENT_CONTROL)
|
||||||
continue;
|
continue;
|
||||||
if (!visual) {
|
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);
|
tty_bell(&c->tty);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (c->session->curw->window == w)
|
if (action == BELL_CURRENT && c->session->curw->window == w)
|
||||||
status_message_set(c, "Bell in current window");
|
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);
|
status_message_set(c, "Bell in window %d", wl->idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
tmux.1
8
tmux.1
@ -2375,16 +2375,18 @@ Set the base index from which an unused index should be searched when a new
|
|||||||
window is created.
|
window is created.
|
||||||
The default is zero.
|
The default is zero.
|
||||||
.It Xo Ic bell-action
|
.It Xo Ic bell-action
|
||||||
.Op Ic any | none | current
|
.Op Ic any | none | current | other
|
||||||
.Xc
|
.Xc
|
||||||
Set action on window bell.
|
Set action on window bell.
|
||||||
.Ic any
|
.Ic any
|
||||||
means a bell in any window linked to a session causes a bell in the current
|
means a bell in any window linked to a session causes a bell in the current
|
||||||
window of that session,
|
window of that session,
|
||||||
.Ic none
|
.Ic none
|
||||||
means all bells are ignored and
|
means all bells are ignored,
|
||||||
.Ic current
|
.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
|
.It Xo Ic bell-on-alert
|
||||||
.Op Ic on | off
|
.Op Ic on | off
|
||||||
.Xc
|
.Xc
|
||||||
|
1
tmux.h
1
tmux.h
@ -75,6 +75,7 @@ extern char **environ;
|
|||||||
#define BELL_NONE 0
|
#define BELL_NONE 0
|
||||||
#define BELL_ANY 1
|
#define BELL_ANY 1
|
||||||
#define BELL_CURRENT 2
|
#define BELL_CURRENT 2
|
||||||
|
#define BELL_OTHER 3
|
||||||
|
|
||||||
/* Special key codes. */
|
/* Special key codes. */
|
||||||
#define KEYC_NONE 0xfff
|
#define KEYC_NONE 0xfff
|
||||||
|
Loading…
Reference in New Issue
Block a user