X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:subject:mime-version:content-type
	:content-transfer-encoding:date:from:cc:in-reply-to:references
	:message-id; q=dns; s=default; b=lgT3vYdyfIISHDyc4u5pjuY4TIwrpUP
	CrHcHa2dYnlTtoJwCaVWSY0cF/EAfUCQrluMlnNUWV63SWALeW2F0OtCOVAgNgh6
	qx2mleUFqSMrYErY5BRO3n27HIqaoOlccD+QAK+GUI6jCsMEKkIukqBfC3NnaGSm
	LN6nxomHe9Qk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:to:subject:mime-version:content-type
	:content-transfer-encoding:date:from:cc:in-reply-to:references
	:message-id; s=default; bh=VhHkm1DTDx81VevRiHW6Bi6/9yA=; b=BJJUo
	zzrASOka8QO6EBGEeG0kajkP+OeLMNMpcT1DVVpOrYRSZomfzKFo8RQRt0QokDJs
	w9S1vnuZ6zl8oZQsqKmlmOvxh5UlUzPxl+kfBUKVZLuc6+rBDtVGiznjwUjOObAn
	5kbgugYld2Mez1ul4RUkSux1dmy/XN4j93hf9U=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Delivered-To: corinna-cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:64.59.134.13, Hx-spam-relays-external:64.59.134.13, heights, H*Ad:U*corinna-cygwin
X-Spam-User: qpsmtpd, 2 recipients
X-HELO: smtp-out-no.shaw.ca
X-Authority-Analysis: v=2.2 cv=eo2d9chX c=1 sm=1 tr=0 a=WiYoHcCliNeVponEdG0Ckg==:117 a=WiYoHcCliNeVponEdG0Ckg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=cAmyUtKerLwA:10 a=zK-Cw2R2LNhHUaA0DlIA:9
To: cygwin@cygwin.com
Subject: Re: [PATCH] Strange behavior of cmd.exe when hammered with clear  screen operations from Cygwin program.
X-PHP-Originating-Script: 501:rcmail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Date: Wed, 27 Jul 2016 13:36:06 -0700
From: Kaz Kylheku <kaz@kylheku.com>
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
In-Reply-To: <20160727184511.GA29214@calimero.vinschen.de>
References: <05e87c9326e8bc9a32a5a3cd2511fe98@mail.kylheku.com> <9b05b6502dc0bdba2654069cfa924a50@mail.kylheku.com> <6d026b0ea424481879a89d480730c1f4@mail.kylheku.com> <49c8dca543daed3fa35b29e41ebf449b@mail.kylheku.com> <50bb6b3942d5fb67057465f8b09b7121@mail.kylheku.com> <20160727184511.GA29214@calimero.vinschen.de>
Message-ID: <d6d7e303024a420a549756f505ce09f2@mail.kylheku.com>
X-Sender: kaz@kylheku.com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfM9gqeQi6FPumkvAzYkmusVFFG+1SI0m1F1/pMqEIy2h0Xg4RexR44FtuRQza0nalqBehkAKoF/jnBUz8d0mCbFvbH2oozBwOsvMUqFRLLpOPs1gmKs0 RW5VB+Cz+V3s4jAZEFtteaHF2l2DkziOnW6e6HPRLABulSdyAG/Cw8vE5yFkIrzcK2TRFdNDe8gz0w==
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u6RKawmO006831

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


