mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 10:08:47 +00:00
Sync OpenBSD patchset 1137:
Tidy up bell code, from Thomas Adam.
This commit is contained in:
parent
fce30422f3
commit
a401420273
@ -76,46 +76,25 @@ server_window_check_bell(struct session *s, struct winlink *wl)
|
|||||||
return (0);
|
return (0);
|
||||||
if (s->curw != wl || s->flags & SESSION_UNATTACHED)
|
if (s->curw != wl || s->flags & SESSION_UNATTACHED)
|
||||||
wl->flags |= WINLINK_BELL;
|
wl->flags |= WINLINK_BELL;
|
||||||
|
if (s->flags & SESSION_UNATTACHED)
|
||||||
|
return (1);
|
||||||
|
|
||||||
|
visual = options_get_number(&s->options, "visual-bell");
|
||||||
action = options_get_number(&s->options, "bell-action");
|
action = options_get_number(&s->options, "bell-action");
|
||||||
switch (action) {
|
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
||||||
case BELL_ANY:
|
c = ARRAY_ITEM(&clients, i);
|
||||||
if (s->flags & SESSION_UNATTACHED)
|
if (c == NULL || c->session != s)
|
||||||
break;
|
continue;
|
||||||
visual = options_get_number(&s->options, "visual-bell");
|
if (!visual) {
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
tty_bell(&c->tty);
|
||||||
c = ARRAY_ITEM(&clients, i);
|
continue;
|
||||||
if (c == NULL || c->session != s)
|
|
||||||
continue;
|
|
||||||
if (!visual) {
|
|
||||||
tty_bell(&c->tty);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (c->session->curw->window == w) {
|
|
||||||
status_message_set(c, "Bell in current window");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
status_message_set(c, "Bell in window %u",
|
|
||||||
winlink_find_by_window(&s->windows, w)->idx);
|
|
||||||
}
|
}
|
||||||
break;
|
if (c->session->curw->window == w)
|
||||||
case BELL_CURRENT:
|
|
||||||
if (s->flags & SESSION_UNATTACHED)
|
|
||||||
break;
|
|
||||||
visual = options_get_number(&s->options, "visual-bell");
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
|
|
||||||
c = ARRAY_ITEM(&clients, i);
|
|
||||||
if (c == NULL || c->session != s)
|
|
||||||
continue;
|
|
||||||
if (c->session->curw->window != w)
|
|
||||||
continue;
|
|
||||||
if (!visual) {
|
|
||||||
tty_bell(&c->tty);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
status_message_set(c, "Bell in current window");
|
status_message_set(c, "Bell in current window");
|
||||||
|
else if (action == BELL_ANY) {
|
||||||
|
status_message_set(c, "Bell in window %u",
|
||||||
|
winlink_find_by_window(&s->windows, w)->idx);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
|
Loading…
Reference in New Issue
Block a user