delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/08/18/08:28:24

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-developers-unsubscribe-archive-cygwin-developers=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: Terminal handling with the 990809 snapshot
References: <19990810210956 DOT A15706 AT ba DOT best DOT com>
<19990811154056 DOT C1219 AT cygnus DOT com> <19990817145646 DOT C10229 AT ba DOT best DOT com>
<19990817161636 DOT C976 AT cygnus DOT com> <s1sogg6m1az DOT fsf AT jaist DOT ac DOT jp>
<19990818042915 DOT A18145 AT ba DOT best DOT com>
Mime-Version: 1.0 (generated by tm-edit 7.106)
From: Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
Date: 18 Aug 1999 21:23:48 +0900
In-Reply-To: Glenn Spell's message of Wed, 18 Aug 1999 04:29:15 -0400
Message-ID: <s1siu6dmg4r.fsf@jaist.ac.jp>
Lines: 74
X-Mailer: Gnus v5.3/Emacs 19.34

>>> On Wed, 18 Aug 1999 04:29:15 -0400
>>> Glenn Spell <glenn AT gs DOT fay DOT nc DOT us> said:

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

There are a few problems.  Handling of CR should also revert to
the previous behavior. My previous patch has a bug on a console
with a scroll buffer on WinNT.

The following is a patch against the 1999-Aug-14 snapshot.

--- fhandler_console.cc-	Fri Aug 06 10:28:23 1999
+++ fhandler_console.cc	Wed Aug 18 21:17:53 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,19 @@ 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);
+		  y--;
+		}
+	      else
+		WriteFile (get_output_handle (), "\n", 1, &done, 0);
 	    }
+	  if (!get_w_binary ())
+	    x = 0;
+	  cursor_set (FALSE, x, y + 1);
 	  break;
 	case BAK:
 	  cursor_rel (-1, 0);
@@ -1007,6 +1009,9 @@ fhandler_console::write_normal (const un
 	  cursor_rel (1, 0);
 	  break;
 	case CR:
+	  cursor_get (&x, &y);
+	  cursor_set (FALSE, 0, y);
+	  break;
 	case ERR:
 	  WriteFile (get_output_handle (), src, 1, &done, 0);
 	  break;

____
  | AIST      Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019