Attachment: tmux_detached_flags_2.patch
Description: Binary data


On Jan 20, 2012, at 2:12 PM, Nicholas Marriott wrote:

> Hi
> 
> Comments inline, thanks.
> 
> On Wed, Jan 11, 2012 at 10:16:18PM -0500, Roland Walker wrote:
>> Alert flags are not displayed for the active window.  This makes sense when 
>> the session is attached: the user can see all relevant activity directly.
>> 
>> However, using -F we can peek at window_flags on a detached session.  Say 
>> the user executes
>> 
>>  tmux lsw -F '#{window_name}|#{window_flags}'
>> 
>> Here it might be preferable to show alert flags on the active window, just 
>> as any other.  The included patch implements this change.
>> 
>> Roland
>> 
>> 
>> cmd-attach-session.c |    2 ++
>> server-window.c      |   12 +++++++-----
>> 2 files changed, 9 insertions(+), 5 deletions(-)
>> 
>> Index: server-window.c
>> ===================================================================
>> --- server-window.c  (revision 2657)
>> +++ server-window.c  (working copy)
>> @@ -56,8 +56,10 @@
>>                              server_status_session(s);
>>                      TAILQ_FOREACH(wp, &w->panes, entry)
>>                              server_window_check_content(s, wl, wp);
>> +
>> +                    if (!(s->flags & SESSION_UNATTACHED))
>> +                            w->flags &= ~(WINDOW_BELL|WINDOW_ACTIVITY);
> 
> Why did you move this inside the loop?

Because the loop iterates over the sessions, and I am testing the session flags 
before allowing the window flags to be cleared.  Did I miss something?

> 
>>              }
>> -            w->flags &= ~(WINDOW_BELL|WINDOW_ACTIVITY);
>>      }
>> }
>> 
>> @@ -72,7 +74,7 @@
>> 
>>      if (!(w->flags & WINDOW_BELL) || wl->flags & WINLINK_BELL)
>>              return (0);
>> -    if (s->curw != wl)
>> +    if (s->curw != wl || s->flags & SESSION_UNATTACHED)
>>              wl->flags |= WINLINK_BELL;
>> 
>>      action = options_get_number(&s->options, "bell-action");
>> @@ -129,7 +131,7 @@
>> 
>>      if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_ACTIVITY)
>>              return (0);
>> -    if (s->curw == wl)
>> +    if (s->curw == wl && !(s->flags & SESSION_UNATTACHED))
>>              return (0);
>> 
>>      if (!options_get_number(&w->options, "monitor-activity"))
>> @@ -165,7 +167,7 @@
>>      if (!(w->flags & WINDOW_SILENCE) || wl->flags & WINLINK_SILENCE)
>>              return (0);
>> 
>> -    if (s->curw == wl) {
>> +    if (s->curw == wl && !(s->flags & SESSION_UNATTACHED)) {
>>              /*
>>               * Reset the timer for this window if we've focused it.  We
>>               * don't want the timer tripping as soon as we've switched away
>> @@ -217,7 +219,7 @@
>>      /* Activity flag must be set for new content. */
>>      if (!(w->flags & WINDOW_ACTIVITY) || wl->flags & WINLINK_CONTENT)
>>              return (0);
>> -    if (s->curw == wl)
>> +    if (s->curw == wl && !(s->flags & SESSION_UNATTACHED))
>>              return (0);
>> 
>>      ptr = options_get_string(&w->options, "monitor-content");
>> Index: cmd-attach-session.c
>> ===================================================================
>> --- cmd-attach-session.c     (revision 2657)
>> +++ cmd-attach-session.c     (working copy)
>> @@ -76,6 +76,7 @@
>>              ctx->curclient->session = s;
>>              session_update_activity(s);
>>              server_redraw_client(ctx->curclient);
>> +            s->curw->flags &= ~WINLINK_ALERTFLAGS;
>>      } else {
>>              if (!(ctx->cmdclient->flags & CLIENT_TERMINAL)) {
>>                      ctx->error(ctx, "not a terminal");
>> @@ -104,6 +105,7 @@
>>              environ_update(update, &ctx->cmdclient->environ, &s->environ);
>> 
>>              server_redraw_client(ctx->cmdclient);
>> +            s->curw->flags &= ~WINLINK_ALERTFLAGS;
> 
> Does this need to happen in switch-client too?

Good point, revision is in attachment.

The other point of interest is the static menu in choose-window.

R

> 
>>      }
>>      recalculate_sizes();
>>      server_update_socket();
>> ------------------------------------------------------------------------------
>> RSA(R) Conference 2012
>> Mar 27 - Feb 2
>> Save $400 by Jan. 27
>> Register now!
>> http://p.sf.net/sfu/rsa-sfdev2dev2
>> _______________________________________________
>> tmux-users mailing list
>> tmux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to