summaryrefslogtreecommitdiffstats
authorRaghavendra D Prabhu <[email protected]>2010-09-29 16:32:34 (GMT)
committer Raghavendra D Prabhu <[email protected]>2010-09-29 16:32:34 (GMT)
commit2a75fc4f7328ca54acb7e9e592412c74ac17f2bf (patch) (side-by-side diff)
treec7ebb1e1a4b01db621619ff791cf7a7ffabdb30c
parent4e4aed43dc2b40b36f1b31cd3af9f874b78fa454 (diff)
downloadtmux-old-2a75fc4f7328ca54acb7e9e592412c74ac17f2bf.zip
tmux-old-2a75fc4f7328ca54acb7e9e592412c74ac17f2bf.tar.gz
tmux-old-2a75fc4f7328ca54acb7e9e592412c74ac17f2bf.tar.bz2
Bell all
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-set-option.c1
-rw-r--r--config.h39
-rw-r--r--config.mk4
-rw-r--r--server-window.c18
-rw-r--r--tmux.c1
5 files changed, 58 insertions, 5 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c
index 9fb9a03..924f7f9 100644
--- a/cmd-set-option.c
+++ b/cmd-set-option.c
@@ -133,6 +133,7 @@ const struct set_option_entry set_session_option_table[] = {
{ "update-environment", SET_OPTION_STRING, 0, 0, NULL },
{ "visual-activity", SET_OPTION_FLAG, 0, 0, NULL },
{ "visual-bell", SET_OPTION_FLAG, 0, 0, NULL },
+ { "bell-all", SET_OPTION_FLAG, 0, 0, NULL },
{ "visual-content", SET_OPTION_FLAG, 0, 0, NULL },
{ NULL, 0, 0, 0, NULL }
};
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..ad15f3e
--- a/dev/null
+++ b/config.h
@@ -0,0 +1,39 @@
+/* Linux */
+#undef HAVE_ASPRINTF
+#undef HAVE_BROKEN_CMSG_FIRSTHDR
+#undef HAVE_BROKEN_CURSES_H
+#undef HAVE_BROKEN_KQUEUE
+#undef HAVE_BROKEN_POLL
+#undef HAVE_BZERO
+#undef HAVE_CRYPT_H
+#undef HAVE_DAEMON
+#undef HAVE_FGETLN
+#undef HAVE_FORKPTY
+#undef HAVE_GETOPT
+#undef HAVE_IMSG
+#undef HAVE_LIBUTIL_H
+#undef HAVE_PATHS_H
+#undef HAVE_PROGNAME
+#undef HAVE_PTY_H
+#undef HAVE_QUEUE_H
+#undef HAVE_SETPROCTITLE
+#undef HAVE_STRCASESTR
+#undef HAVE_STRLCAT
+#undef HAVE_STRLCPY
+#undef HAVE_STRSEP
+#undef HAVE_STRTONUM
+#undef HAVE_TREE_H
+#undef HAVE_UTIL_H
+#undef HAVE_U_INT
+#undef HAVE_VIS
+#define HAVE_ASPRINTF
+#define HAVE_BZERO
+#define HAVE_DAEMON
+#define HAVE_FORKPTY
+#define HAVE_PATHS_H
+#define HAVE_PROGNAME
+#define HAVE_PTY_H
+#define HAVE_SETENV
+#define HAVE_STRCASESTR
+#define HAVE_STRSEP
+#define HAVE_U_INT
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..83bb11d
--- a/dev/null
+++ b/config.mk
@@ -0,0 +1,4 @@
+# Linux
+CFLAGS+= -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE
+LIBS+= -lncurses -lcrypt -lutil -levent -lrt
+SRCS+= osdep-linux.c compat/fgetln.c compat/strlcat.c compat/strlcpy.c compat/strtonum.c compat/getopt.c compat/vis.c compat/unvis.c compat/imsg-buffer.c compat/imsg.c
diff --git a/server-window.c b/server-window.c
index 713c8cb..fbe40a3 100644
--- a/server-window.c
+++ b/server-window.c
@@ -69,7 +69,7 @@ server_window_check_bell(struct session *s, struct winlink *wl)
struct client *c;
struct window *w = wl->window;
u_int i;
- int action, visual;
+ int action, visual,bell;
if (!(w->flags & WINDOW_BELL) || wl->flags & WINLINK_BELL)
return (0);
@@ -77,19 +77,25 @@ server_window_check_bell(struct session *s, struct winlink *wl)
wl->flags |= WINLINK_BELL;
action = options_get_number(&s->options, "bell-action");
+ visual = options_get_number(&s->options, "visual-bell");
+ bell = options_get_number(&s->options, "bell-all");
switch (action) {
case BELL_ANY:
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 (!visual) {
+ if (bell) {
+ tty_putcode(&c->tty, TTYC_BEL);
+ //continue;
+ }
+ else if (!visual) {
tty_putcode(&c->tty, TTYC_BEL);
continue;
}
+
if (c->session->curw->window == w) {
status_message_set(c, "Bell in current window");
continue;
@@ -101,14 +107,16 @@ server_window_check_bell(struct session *s, struct winlink *wl)
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) {
+ if (bell) {
+ tty_putcode(&c->tty, TTYC_BEL);
+ //continue;
+ } else if (!visual) {
tty_putcode(&c->tty, TTYC_BEL);
continue;
}
diff --git a/tmux.c b/tmux.c
index 02e84bc..5de0593 100644
--- a/tmux.c
+++ b/tmux.c
@@ -390,6 +390,7 @@ main(int argc, char **argv)
options_set_number(so, "visual-activity", 0);
options_set_number(so, "visual-bell", 0);
options_set_number(so, "visual-content", 0);
+ options_set_number(so, "bell-all", 1);
keylist = xmalloc(sizeof *keylist);
ARRAY_INIT(keylist);