summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-08-01 12:35:51 +0200
committerCorinna Vinschen <corinna@vinschen.de>2016-08-01 12:42:54 +0200
commit05847ad6e9b505b0d66292bc7ca126e323be3e23 (patch)
tree60e1614b2e839638840a84bfcc3c85d55e382f65 /winsup/cygwin/fhandler_console.cc
parent11dcf9cb5cf4f7f15799dedc9cdeab3cae0de64e (diff)
downloadcygnal-05847ad6e9b505b0d66292bc7ca126e323be3e23.tar.gz
cygnal-05847ad6e9b505b0d66292bc7ca126e323be3e23.tar.bz2
cygnal-05847ad6e9b505b0d66292bc7ca126e323be3e23.zip
Fix console clear screen in case of partial scrolling
Commit d7586cb incorrectly checked only for the new cursor position beyond the old cursor position to decide if we have to correct for user scrolling. Since this situation is handled just fine if the cursor is still visible, only perform the subsequent correction if the cursor is not in the visible console window. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index f083f7e67..24e3a10f5 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1288,8 +1288,8 @@ fhandler_console::clear_screen (cltype xc1, cltype yc1, cltype xc2, cltype yc2)
/* Make correction for the following situation: The console buffer
is only partially used and the user scrolled down into the as yet
- unused area. */
- if (oldEndY < con.dwEnd.Y)
+ unused area so far that the cursor is outside the window buffer. */
+ if (oldEndY < con.dwEnd.Y && oldEndY < con.b.srWindow.Top)
{
con.dwEnd.Y = con.b.dwCursorPosition.Y = oldEndY;
y1 = con.b.srWindow.Top;