pane redraw condition seems wrong

2011-03-08 Thread Yusuke ENDOH
Hello,

This is an excerpt of tty_redraw_region in tty.c:


451 /*
452  * If region is = 50% of the screen, just schedule a
window redraw. In
453  * most cases, this is likely to be followed by some more
scrolling -
454  * without this, the entire pane ends up being redrawn
many times which
455  * can be much more data.
456  */
457 if (ctx-orupper - ctx-orlower = screen_size_y(s) / 2) {
458 wp-flags |= PANE_REDRAW;
459 return;
460 }


I suspect that ctx-orupper - ctx-orlower causes underflow
because ctx-orupper is less or equal than orlower and their
types are unsigned.  This mean this condition is always true
unless they are equal.

I could be wrong, but is this condition right?

Thanks,

-- 
Yusuke Endoh m...@tsg.ne.jp

--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: ESC key seems slow in tmux

2011-03-08 Thread Björn Oelke
Am 08.03.2011 um 16:42 schrieb Chas. Owens:
 
 I use vi bindings in bash and I have notice a significant delay
 between pressing ESC and bash seeing the ESC, is there some timeout in
 tmux that is waiting to see if I send anything else after the ESC
 before passing it on to bash?  If so, is there any way to decrease
 that timeout?

Very good question. I also noticed this behavior when binding the escape key to 
some tmux command in .tmux.conf, like copy-mode (bind-key Escape copy-mode). 
But it doesn't happen when e.g. vi is started inside of tmux.

-- 
BO .. http://kbct.de
P.S.: Moin.



--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: ESC key seems slow in tmux

2011-03-08 Thread Thomas Adam
On 8 March 2011 15:42, Chas. Owens chas.ow...@gmail.com wrote:
 I use vi bindings in bash and I have notice a significant delay
 between pressing ESC and bash seeing the ESC, is there some timeout in
 tmux that is waiting to see if I send anything else after the ESC
 before passing it on to bash?  If so, is there any way to decrease
 that timeout?

In tmux, this is what the escape-time is for,

-- Thomas Adam

--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: ESC key seems slow in tmux

2011-03-08 Thread Chas. Owens
On Tue, Mar 8, 2011 at 11:26, Thomas Adam tho...@xteddy.org wrote:
 On 8 March 2011 15:42, Chas. Owens chas.ow...@gmail.com wrote:
 I use vi bindings in bash and I have notice a significant delay
 between pressing ESC and bash seeing the ESC, is there some timeout in
 tmux that is waiting to see if I send anything else after the ESC
 before passing it on to bash?  If so, is there any way to decrease
 that timeout?

 In tmux, this is what the escape-time is for,

 -- Thomas Adam


Thanks, that seems to have done the trick.  So, what danger is there
to setting it 50 milliseconds vs the default 500?  Under what
circumstances should I need half a second to enter an escape sequence?


-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: pane redraw condition seems wrong

2011-03-08 Thread Nicholas Marriott
Yep this is wrong, doh, they should be the other way round. Fixed,
thanks.

On Wed, Mar 09, 2011 at 12:58:48AM +0900, Yusuke ENDOH wrote:
 Hello,
 
 This is an excerpt of tty_redraw_region in tty.c:
 
 
 451   /*
 452* If region is = 50% of the screen, just schedule a
 window redraw. In
 453* most cases, this is likely to be followed by some more
 scrolling -
 454* without this, the entire pane ends up being redrawn
 many times which
 455* can be much more data.
 456*/
 457   if (ctx-orupper - ctx-orlower = screen_size_y(s) / 2) {
 458   wp-flags |= PANE_REDRAW;
 459   return;
 460   }
 
 
 I suspect that ctx-orupper - ctx-orlower causes underflow
 because ctx-orupper is less or equal than orlower and their
 types are unsigned.  This mean this condition is always true
 unless they are equal.
 
 I could be wrong, but is this condition right?
 
 Thanks,
 
 -- 
 Yusuke Endoh m...@tsg.ne.jp
 
 --
 What You Don't Know About Data Connectivity CAN Hurt You
 This paper provides an overview of data connectivity, details
 its effect on application quality, and explores various alternative
 solutions. http://p.sf.net/sfu/progress-d2d
 ___
 tmux-users mailing list
 tmux-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/tmux-users

--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users