This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH] Strange behavior of cmd.exe when hammered with clear screen operations from Cygwin program.
- From: Kaz Kylheku <kaz at kylheku dot com>
- To: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- Cc: cygwin at cygwin dot com
- Date: Thu, 28 Jul 2016 09:36:16 -0700
- Subject: Re: [PATCH] Strange behavior of cmd.exe when hammered with clear screen operations from Cygwin program.
- Authentication-results: sourceware.org; auth=none
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
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
| >  cursor
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple