delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/03/22:59:35

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:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=wfJ5PcOO1u/dGYVW6B5SoSiVVSBfPxcj2dqY6yxDWyYzfvxymi+oZ
fcQd0TL/C/QIOK4Ip7CV94W1MBEqnTqrz9AIYF83MRJmtfJnhGCYBTPrQOJHT/WN
CPdFnAXj3JoOTOUWcQTdfl5homVqsIZW4PfSLGZDbIg9fdRwS+BPr0=
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:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=S4ajwOcjW91aurjJgsd9XMuZu2g=; b=en9efuX+jvN5PIFqfbUNU7SK6LLT
Ie5wtSiRs73pDLd8d+KQv+1KXknRgnmRBQ1SzTjArmbEgmma5o2juuQAhJXTEqPh
pltPfZmrdvYVURYi3gkZQKBFSb3R45l+Uup1MIK19anB+dUgly2wzxP0hmIdsFT+
DeZS+9iJkfutymc=
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.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Dawid Ferenczy <ferenczy AT volny DOT cz>
Subject: Re: Clearing the buffer after quitting LESS, MAN, VIM etc.
Date: Sat, 4 Jan 2014 03:58:44 +0000 (UTC)
Lines: 48
Message-ID: <loom.20140104T042813-236@post.gmane.org>
References: <loom DOT 20131231T025559-913 AT post DOT gmane DOT org> <8545c95dp8ns21seorjf67o4eueglcarsk AT 4ax DOT com> <20131231185859 DOT GA4460 AT ednor DOT casa DOT cgf DOT cx> <20131231222904 DOT GA5441 AT ednor DOT casa DOT cgf DOT cx> <loom DOT 20140103T011837-791 AT post DOT gmane DOT org> <20140103065626 DOT GB2538 AT ednor DOT casa DOT cgf DOT cx>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes

Christopher Faylor <cgf-use-the-mailinglist-please <at> cygwin.com> writes:

> Problems like that interfere with my sleep so it's best to get them out
> of the way before I go to bed.  

Hi Christopher,

that's the difference between real programmers and other coders. Real
programmer can't go to bed, when he has unsolved issue ;)


> >Could you briefly describe what was the nature of that limitation and 
how did 
> >you fixed it, please? (technically, I'm a developer too)
> 
> The problem is described here:
> 
> http://stackoverflow.com/questions/14699043/replacement-to-systemcolor
> 
> in the first Answer.
> 
> I found this after noticing the strange behavior of ReadConsoleOutput.


Thank you, I have a point, now. Moreover I have read the diff of your fix.

And the fix is almost perfect. It's only almost perfect, because it
preserves the visible buffer only, not the whole scrollback buffer, which
could be much more larger, than the window size. I can live with that, but
could it be possible to preserve the whole scrollback buffer, no
matters how big it is? I have a window size of 240 * 70 and scrollback
buffer of 240 * 9999 characters.

So we need to split the buffer to the regions smaller than 16384 characters
(to fit buffer in a heap). Maybe it could be possible to get the
scrollback buffer dimensions instead of the window dimensions and use
ReadConsoleOutputWrapper in a loop (buffer_width * buffer_height / 16384
iterations). Moreover, if the window size is bigger than 32768 characters,
your fix will fail, because you attempt to read a region bigger than
16384 characters at once.

But it's interesting that when I have the window size smaller than 16384
characters (240 * 62), the whole scrollback buffer is preserved, no
matters how big it is.

Thank you and have a nice day.

Dawid Ferenczy


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