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]

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

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

#include <stdio.h>

int main(void)
  int i;

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

  return 0;

Problem reports:
Unsubscribe info:

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