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: Clearing the buffer after quitting LESS, MAN, VIM etc.

Christopher Faylor <cgf-use-the-mailinglist-please <at>> 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:
> 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:
Unsubscribe info:

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