Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: From: "Town, Brad" To: "'cygwin AT sources DOT redhat DOT com'" Subject: RE: 'clear' does not clear entire screen (affects vim also) Date: Tue, 14 Nov 2000 09:52:09 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C04E4A.76FC5A50" ------_=_NextPart_000_01C04E4A.76FC5A50 Content-Type: text/plain; charset="iso-8859-1" Attached is a minor patch that uses the screen buffer width rather than the window width to calculate the number of spaces to clear. Brad Town > The trouble appears to be due to the way it calculates how > many spaces to > clear. I'll look into it and submit a patch. > > Brad Town > > > > Problem: Bottom portion of screen is not cleared by 'clear' > > if the visible > > screen width is less than the actual (buffer) screen width. > This also > > affects vim because the bottom portion of screen in vim is > not cleared > > before redrawing. This leaves the existing characters on the > > screen in the > > areas where no next is written (i.e. after the ends of > lines and blank > > lines). > > > > To reproduce the problem: > > > > 1. From any bash shell, resize the window narrower so that > a scrollbar > > appears at the bottom of the screen. > > 2. vim a file or run 'clear' > > > > Win2000 > > version 1.1.4 > > > > Jim Hickey > > jim_hickey AT hp DOT com ------_=_NextPart_000_01C04E4A.76FC5A50 Content-Type: application/octet-stream; name="fhandler_console.cc.patch" Content-Disposition: attachment; filename="fhandler_console.cc.patch" --- fhandler_console.cc.orig Thu Nov 2 11:17:39 2000 +++ fhandler_console.cc Tue Nov 14 09:39:28 2000 @@ -264,6 +264,7 @@ static struct SHORT winTop; SHORT winBottom; COORD dwWinSize; + COORD dwBufferSize; COORD dwCursorPosition; WORD wAttributes; } info; @@ -280,6 +281,7 @@ fhandler_console::fillin_info (void) info.winBottom = linfo.srWindow.Bottom; info.dwWinSize.Y = 1 + linfo.srWindow.Bottom - linfo.srWindow.Top; info.dwWinSize.X = 1 + linfo.srWindow.Right - linfo.srWindow.Left; + info.dwBufferSize = linfo.dwSize; info.dwCursorPosition = linfo.dwCursorPosition; info.wAttributes = linfo.wAttributes; } @@ -650,9 +652,9 @@ fhandler_console::clear_screen (int x1, if (y2 < 0) y2 = info.winBottom; - num = abs (y1 - y2) * info.dwWinSize.X + abs (x1 - x2) + 1; + num = abs (y1 - y2) * info.dwBufferSize.X + abs (x1 - x2) + 1; - if ((y2 * info.dwWinSize.X + x2) > (y1 * info.dwWinSize.X + x1)) + if ((y2 * info.dwBufferSize.X + x2) > (y1 * info.dwBufferSize.X + x1)) { tlc.X = x1; tlc.Y = y1; ------_=_NextPart_000_01C04E4A.76FC5A50 Content-Type: text/plain; charset=us-ascii -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com ------_=_NextPart_000_01C04E4A.76FC5A50--