Discussion:
Bell on "background" window only
(too old to reply)
Ján ONDREJ (SAL)
2015-05-12 04:35:22 UTC
Permalink
Hello,

I like tmux, but there is one feature from GNU screen, which is missing
for me. In screen I use belling, but only if they appear in windows in
background. I don't need bell in current active window, but need to know,
if something happens in non-visible windows. How can I do this in tmux?

Tmux nas only option to set bell-action in current window and missing
ability to make it bell in background windows.

In screen I use this:

vbell on
bell 'Belling in window %^G'

This makes bell silent, but ^G will still beep.

And also I need to know, which window beeped in terminal title. Screen
showed me a message, which window is belling.

Is it possible to set custom bell message in tmux? If don't, any chance
to get this in future releases?

Thank you.

SAL
Nicholas Marriott
2015-05-12 08:01:41 UTC
Permalink
Try this please to add bell-action other for bell in not current window.

I don't think we want an option to alter the visual bell message, I
don't think bells are used that much.

You could probably script changing the title by looking at
window_bell_flag (or tmux showmsgs).


Index: options-table.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/options-table.c,v
retrieving revision 1.58
diff -u -p -r1.58 options-table.c
--- options-table.c 11 May 2015 10:58:22 -0000 1.58
+++ options-table.c 12 May 2015 07:57:45 -0000
@@ -49,7 +49,7 @@ const char *options_table_status_positio
"top", "bottom", NULL
};
const char *options_table_bell_action_list[] = {
- "none", "any", "current", NULL
+ "none", "any", "current", "other", NULL
};

/* Server options. */
Index: server-window.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/server-window.c,v
retrieving revision 1.34
diff -u -p -r1.34 server-window.c
--- server-window.c 24 Apr 2015 23:17:11 -0000 1.34
+++ server-window.c 12 May 2015 07:57:45 -0000
@@ -77,13 +77,18 @@ server_window_check_bell(struct session
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);
}

Index: tmux.h
===================================================================
RCS file: /cvs/src/usr.bin/tmux/tmux.h,v
retrieving revision 1.512
diff -u -p -r1.512 tmux.h
--- tmux.h 11 May 2015 10:10:16 -0000 1.512
+++ tmux.h 12 May 2015 07:57:45 -0000
@@ -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
Post by Ján ONDREJ (SAL)
Hello,
I like tmux, but there is one feature from GNU screen, which is missing
for me. In screen I use belling, but only if they appear in windows in
background. I don't need bell in current active window, but need to know,
if something happens in non-visible windows. How can I do this in tmux?
Tmux nas only option to set bell-action in current window and missing
ability to make it bell in background windows.
vbell on
bell 'Belling in window %^G'
This makes bell silent, but ^G will still beep.
And also I need to know, which window beeped in terminal title. Screen
showed me a message, which window is belling.
Is it possible to set custom bell message in tmux? If don't, any chance
to get this in future releases?
Thank you.
SAL
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Loading...