This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Terminal handling with the 990809 snapshot


On 18 Aug 1999 around 8:31AM (+0900) Kazuhiro Fujieda wrote:

> >>> On Tue, 17 Aug 1999 16:16:36 -0400 Chris Faylor
> >>> <cgf@cygnus.com> said:
>
> > I remember one patch that, IIRC, essentially reverted to the
> > previous behavior.  I may be mistaken but I don't remember any
> > indication of considerable effort.  Perhaps Kazuhiro will correct
> > me if I'm wrong.

I believe he has already corrected you once concerning the reversion
issue. Concerning the effort, it was I who presumed that "careful
design" indicates considerable effort.

        On 27 May 1999 around 12:02PM (-0400) Chris Faylor wrote:

        > On Thu, May 27, 1999 at 05:41:32PM +0900, Kazuhiro Fujieda
        > wrote:
        >
        > >>>> On Mon, 17 May 1999 11:23:09 -0400 Chris Faylor
        > >>>> <cgf@cygnus.com> said:
        > >
        > >> This patch essentially reverts the changes that were
        > >> added last month.
        > >
        > >I carefully designed my patch not to spoil the essence of
        > >the changes
        > >
        > >[And I carefully designed my patch] to properly support a
        > >terminal capability of a settable scrolling region.

But, the reversion issue was sidestepped. The subject was changed.

        > The problem was that attributes were screwed up with the
        > previous way of doing thins.

So... are attributes working correctly now?

> My patch wasn't one reverting to the previous behavior (that is the
> current behavior). It could improve scrolling speed, and didn't get
> back the attribute problem pointed out by Glenn.

I'm currently using your patch (actually, both patches) with the
990814 sources. It not only fixes the attribute problem but the
display performs faster. The speed improvement is especially
noticeable when running 'bash' from within 'screen'.

If you were to resubmit your patch against the current snapshot,
would it look something like this?

--- fhandler_console.cc.ORIG	Thu Aug 05 21:28:24 1999
+++ fhandler_console.cc		Wed Aug 18 00:47:12 1999
@@ -34,7 +34,7 @@ static struct
     } scroll_region = {0, -1};
 
 #define srTop (info.winTop + scroll_region.Top)
-#define srBottom (info.winTop + scroll_region.Bottom)
+#define srBottom ((scroll_region.Bottom < 0) ? info.winBottom : info.winTop + scroll_region.Bottom)
 
 #define use_tty ISSTATE (myself, PID_USETTY)
 
@@ -195,9 +195,6 @@ fhandler_console::fillin_info (void)
       info.winBottom = 24;
     }
 
-  if (scroll_region.Bottom < 0)
-    scroll_region.Bottom = info.dwWinSize.Y - 1;
-
   return ret;
 }
 
@@ -991,14 +988,18 @@ fhandler_console::write_normal (const un
 	  break;
 	case DWN:		/* WriteFile("\n") always adds CR... */
 	  cursor_get (&x, &y);
-	  WriteFile (get_output_handle (), "\n", 1, &done, 0);
-	  if (get_w_binary ())
-	    cursor_rel (x, 0);
-	  if (y == srBottom && y < info.winBottom)
+	  if (y == srBottom)
 	    {
-	      scroll_screen (0, srTop + 1, -1, srBottom, 0, srTop);
-	      cursor_set (FALSE, x, y);
+	      if (y < info.winBottom || scroll_region.Top)
+		scroll_screen (0, srTop + 1, -1, srBottom, 0, srTop);
+	      else
+		WriteFile (get_output_handle (), "\n", 1, &done, 0);
 	    }
+	  else
+	    y++;
+	  if (!get_w_binary ())
+	      x = 0;
+	  cursor_set (FALSE, x, y);
 	  break;
 	case BAK:
 	  cursor_rel (-1, 0);

-glenn

-- 
 )      Glenn Spell <glenn@gs.fay.nc.us>      )   _       _____
 )   Fayetteville, North Carolina, U. S. A.   )_ (__\____o /_/_ |
 )     _  _  _  _  _  _  _  _  _  _  _  _     )   >-----._/_/__]>
 )--- Cygwin - Don't leave Unix without it ---)             `0  |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]