This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: Strange behavior of cmd.exe when hammered with clear screen operations from Cygwin program.

On 26.07.2016 22:19, Kaz Kylheku wrote:
The test program featured below works fine under
the Cygwin console window.

If executed from a cmd.exe console, strange things happen with the
cmd.exe window. Suddenly, the window spontaneously resizes so that
is taller than the desktop. A horizontal scrollbar may appear in it
also, as well as an unpainted area through which the desktop is
visible. As soon as you try to grab the title bar to resize it, it
disappears. It hasn't quit; it is actually minimized. You can
maximize it from the task bar and then resize the tall window to
its original shape.

Narrowed it down to the con.scroll_window call in

The following test change makes the behavior go away. Moreover,
the repeated clear screen requests stop making the vertical scroll
bar jump around like crazy:

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 5fe4480..2b8acb5 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -1261,7 +1261,9 @@ fhandler_console::clear_screen (cltype xc1, cltype yc1, cltype xc2, cltype yc2)

/* Detect special case - scroll the screen if we have a buffer in order to
      preserve the buffer. */
+#if 0
   if (!con.scroll_window (h, x1, y1, x2, y2))
     con.clear_screen (h, x1, y1, x2, y2);

Problem reports:
Unsubscribe info:

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