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



On Tue, May 12, 2015 at 06:35:22AM +0200, J??n ONDREJ (SAL) wrote:
> 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
> 
> ------------------------------------------------------------------------------
> 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
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
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
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to