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: [PATCH] Strange behavior of cmd.exe when hammered with clear screen operations from Cygwin program.


On 27.07.2016 11:45, Corinna Vinschen wrote:
Btw, since you're apparently building your own Cygwin DLL I thought just
sending the patch for testing is sufficient.  If you prefer to get a
developer snapshot with this patch, I can do that, too. Just say the word.

The patch looks good and in many cases avoids padding the history with
blank lines, compared to the naive newline emission approach.

Usually, the clear screen operation is preceded by a homing of the cursor. I.e., in VT100 language: ESC [ H, ESC [ 2 J. In this case, your approach
seems to nicely trim the console data at that line. Rather, that is to
say, when we scroll back, there aren't any blank lines, since none were
added; the clear was done as a pure scrolling operation without any
padding data.

Blank lines are only generated if the cursor is in the middle of the
buffer. Since the cursor position is restored after the scrolling,
that then adds blank lines between the scrolled-away material and the
cursor position. And if the clear is repeated at that position,
more blank lines are added for each repetition. Who cares about that case,
though.

Other implementations behave the same way, if not worse.

Case in point: Gnome Terminal (3.4.1.1) behaves like my naive \n
repetition patch! Every issue of ESC [ 2 J adds a window height's
worth of blank lines to the history,  regardless of the position
of the cursor!  That is what I compared to as a "gold standard",
so I was okay with it.

--
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


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