Hi

Did you send anything later on this? I only see this as the last mail
still in my inbox.

You don't need to call server_status_client so often - it just sets a
flag. Below is a changed diff to server-client.c alone which should be
all you need and I think is fine.

But I'm not sure about the indicator - why did you choose ^ and _? It
seems ugly.


Index: server-client.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/server-client.c,v
retrieving revision 1.82
diff -u -p -r1.82 server-client.c
--- server-client.c     15 Jan 2013 22:55:29 -0000      1.82
+++ server-client.c     16 Jan 2013 05:49:22 -0000
@@ -432,6 +432,7 @@ server_client_handle_key(struct client *
 
        /* Prefix key already pressed. Reset prefix and lookup key. */
        c->flags &= ~CLIENT_PREFIX;
+       server_status_client(c);
        if ((bd = key_bindings_lookup(key | KEYC_PREFIX)) == NULL) {
                /* If repeating, treat this as a key, else ignore. */
                if (c->flags & CLIENT_REPEAT) {
@@ -587,8 +588,11 @@ server_client_repeat_timer(unused int fd
 {
        struct client   *c = data;
 
-       if (c->flags & CLIENT_REPEAT)
+       if (c->flags & CLIENT_REPEAT) {
+               if (c->flags & CLIENT_PREFIX)
+                       server_status_client(c);
                c->flags &= ~(CLIENT_PREFIX|CLIENT_REPEAT);
+       }
 }
 
 /* Check if client should be exited. */



On Tue, Aug 14, 2012 at 09:52:54PM +0100, Nicholas Marriott wrote:
> server_status_client will set the CLIENT_STATUS bit and update when tmux
> returns to the event loop, it's the right thing to do. Also tmux will
> regenerate the status line but not actually draw it unless it has
> changed.
> 
> Even so not sure I'm wild about updating the status line every time the
> prefix key is pressed, but it'd probably be okay.
> 
> 
> 
> 
> On Tue, Aug 14, 2012 at 08:03:32PM +0000, Andrew Reynhout wrote:
> > On Sun, Aug 12, 2012 at 09:09:28AM +0100, Thomas Adam wrote:
> > > I'm not sure how Nicholas feels about this, but this has been on the TODO
> > > list for a while.  I think ideally this should use some form of status-bg
> > > colour change instead of relying on some specific part of the status line 
> > > to
> > > draw some random ASCII symbol.  This would certainly make the code 
> > > cleaner.
> > 
> > I can see why that would be preferable for many situations, but the symbol
> > change is less ambiguous for my purposes (multiple nested tmux'es).
> > 
> > It's valuable and common enough for me that I'm more than happy to sacrifice
> > the two characters of status line width to see the indicator all the time.
> > 
> > Perhaps none, either, or both could be available.
> > 
> > > Also, you don't need to keep calling server_status_client() each time the
> > > CLIENT_PREFIX flag is toggled -- it would be easier to just set it, and 
> > > let
> > > the status_draw() routines handle this when we know a refresh of the 
> > > status
> > > line is needed.
> > 
> > Wouldn't that only update the status line when the refresh timer expires?
> > Is there a way to mark the status line dirty and cause an immediate refresh
> > without calling server_status_client() directly?
> > 
> > Also there's still the problem of testing for situations where the bit
> > might be toggled, but ends up not being. Is this a concern worthy of the
> > extra code it would require?
> > 
> > > Do you think you could repropose a patch like this instead?
> > 
> > Sure, I can give it a spin.
> > 
> > Thanks,
> > Andrew Reynhout
> > 
> > -- 
> > reynh...@quesera.com
> > 
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and 
> > threat landscape has changed and how IT managers can respond. Discussions 
> > will include endpoint security, mobile security and the latest in malware 
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > tmux-users mailing list
> > tmux-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to