summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_console.cc
diff options
context:
space:
mode:
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;