delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/07/28/12:36:57

X-Recipient: archive-cygwin AT delorie DOT 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:message-id; q=dns; s=
default; b=wFdN9Pmkco2iB9d+BjiLu5PJA3RXJZbRojDlj/XVhCFiCF1lbBT99
AYJ+wkiaacfcobXd8pCk3tafV/APfRNY5hdQw6qG65FQMS4WMh7bLYRFSCyRbHUy
Z6oaYnKshhQndC5qq0x08l4H0fmLvNxFnjCt33xBTjqL5tcvKVrexs=
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:message-id; s=default;
bh=j+tU/pbbAGJ4wDpfE/uDD2yYpoI=; b=JQkS0UGjY80oRtum/OPJBNZTKiKI
R3YOy6u26Cpy4OxWl/N4mqVNlhpcT8UUTAqdhXEjz1U+Ad4zoEgaO5BUFl4yg5cM
XIFwOB9HpYDLvnwVgj+Ua2U4HvfNCgGwoXwtM3noZh4IF8NctWtQ1pC/pMUJjiBs
lKErOpyjjR2BUiA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*corinna-cygwin
X-Spam-User: qpsmtpd, 2 recipients
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.2 cv=T/3OdLCQ 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=g7ZSTGUitqbbwgNINoQA:9
To: Corinna Vinschen <corinna-cygwin AT cygwin DOT 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
Date: Thu, 28 Jul 2016 09:36:16 -0700
From: Kaz Kylheku <kaz AT kylheku DOT com>
Cc: cygwin AT cygwin DOT com
Message-ID: <0ee6699f198b7b0f588054ba2f829db5@mail.kylheku.com>
X-Sender: kaz AT kylheku DOT com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfHYftKbflhRnkSxIipKjrxc14K9+UUSObvopssH8RviwSkuIs8IDXbS20dhgG+EMbJ1cko7A/vIDb11beCGEYef59OU2iPkwvDDFDTgjeuZgYEBnmfzu uB0/QnzCZLUMxvgHDdiynOkK91USwUB39bu3WRMqPlXZYkh8/WDmwJM2za7CxB1VFaZv87LbllKIvQ==
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u6SGaqR1016339

On 28.07.2016 00:08, Corinna Vinschen wrote:
> Thanks for testing.  I'll check in the patch as is for now, but I'd
> still be interested to fix the aforementioned empty lines problem,
> even if just for completeness.  If you have an idea, feel free to
> propose.

Hi Corinna,

The blank lines above the cursor position, as well as any
that are below, are entering into the history simply because they
are part of the window content being saved. Any non-blank lines
in their place would be expected to be saved, and no processing
takes place to distinguish blank from non-blank.

One way to address this is to basically scan the entire window
portion of the buffer for trailing blank lines and trim the buffer
to exclude them. Then scroll by the amount of remaining lines
lines, to usher them into the history.

Finally, restore the cursor position.

Or, perhaps, two or more trailing blank lines in the window could be
condensed down to one which does get saved, so the separation
is not misleadingly condensed down to nothing.

However, there are possible arguments against trimming blank
lines which are above the cursor position. Say the window
contains this:

    +---
    | nonblank
    | blank
    | blank
    | > [] cursor
    | blank
    | blank
    | blank
    +---

It's uncontroversial to obliterate the three blank lines below the
cursor. However the blank lines between the nonblank line and
the cursor could be semantic; the user might want them in the
scrollback history "as is".

The leading nonblank line is a red herring; even if all the
lines above the cursor are blank, the reasoning applies.



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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019