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

Kaz Kylheku kaz@kylheku.com
Wed Jul 27 05:19:00 GMT 2016


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.

This is using 32 bit Cygwin 2.5.2, on 64 bit Win 7.

All the program does is hammer Cygwin's VT100 emulation code
with the clear screen escape sequence: ESC [ 2 J.

A 1000 iterations are more than enough to reproduce it;
I made it 10000.

If we change it to 100, some interesting variations
occur. It may take multiple runs of the program to reproduce
a problem. Then, suddenly, the window might shrink vertically
On a subsequent run, it might shrink again. In these situations,
it remains susceptible to a manual resize without
disappearing.


#include <stdio.h>

int main(void)
{
   int i;

   for (i = 0; i < 10000; i++) {
     fputs("\x1b[2J", stdout);
     fflush(stdout);
   }

   return 0;
}



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list