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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=Ux1uOrvUcN55lCjiMQUqDeiq8SA5eJsmFdhd1v/EoegCQWoXP33j8 h+RO2p3qTHF9HoZyd5gA/giPQq2m6wG4pPu070gOiaWpJs65dyQL7zvqeZ2+QXZI 9fR+SAa0SI7B+CW15MIkMe+hFBsUPxYflriVPzE34xascWy0jCPCKs= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=CpgrYM43VERtRjCKMgwsVZ7r3y0=; b=azMGo0ve8oBYLucjEZZ7e04ANiRv o1Y0z34zZGB7FhUoUGIaKi32hyUer8hAdwXlUJZDId2uDwf1wvTszimvbgtEEPvv WeODIAOeZKPsX2B2IdbX+D3LcpQjTRq1szS6cGepjo4rAYJ4Jindu75NzIn1ByrP kDxynbpZAAQbCcA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-95.0 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=H*i:sk:7c08fa8, H*f:sk:7c08fa8, admit, click X-HELO: calimero.vinschen.de Date: Wed, 3 Aug 2016 14:41:27 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: [PATCH] Strange behavior of cmd.exe when hammered with clear screen operations from Cygwin program. Message-ID: <20160803124127.GA17526@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <0ee6699f198b7b0f588054ba2f829db5 AT mail DOT kylheku DOT com> <20160728195135 DOT GC26311 AT calimero DOT vinschen DOT de> <20160729103927 DOT GB5963 AT calimero DOT vinschen DOT de> <20160801085109 DOT GC3470 AT calimero DOT vinschen DOT de> <7c08fa896bb7dadcca91f1a7a26ddf20 AT mail DOT kylheku DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: <7c08fa896bb7dadcca91f1a7a26ddf20@mail.kylheku.com> User-Agent: Mutt/1.6.2 (2016-07-01) --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Aug 2 23:19, Kaz Kylheku wrote: > On 01.08.2016 01:51, Corinna Vinschen wrote: > > On Jul 29 08:59, Kaz Kylheku wrote: > > > On 29.07.2016 03:39, Corinna Vinschen wrote: > > > > I applied a patch to perform this action. It's in the latest > > > > 2.6.0-0.5 test release I just announced. > > > [...] > > > I've done some interactive testing with this using > > > the interpreter for a Lisp dialect. I would evaluate > > > this expression to generate a 5 second delay and then > > > a clear screen VT100 sequence: > > >=20 > > > (progn (usleep 5000000) (put-string "\e[2J")) > > >=20 > > > during this time, I would scroll the buffer somewhere. > > >=20 > > > I also tested with a cursor position somewhere in the > > > middle of the window, having issued: > > >=20 > > > (put-string "\e[12H") > > >=20 > > > The programming language details don't matter; we > > > could do this with bash echo $'\e...' and sleep 5. > > > [...] > > > With the third patch, I've run into behavior in which the > > > display isn't cleared at all if the clear is issued > > > in a scrolled-back state. > >=20 > > I can't reproduce this. If I don't click wildly on the scroll bat at > > the time the clear screen action takes place (so I move the window right > > after clear screen), the cursor is positioned at the top of the screen, > > at the end of the buffer. So, how would I reproduce your observation so > > that all window positioning is guaranteed to take place *before* the > > clear screen action and still see the broken output? >=20 > Hi Corinna, >=20 > I have figured out how to reproduce it. There are two > necessary conditions. No, three: >=20 > 1. You must scroll the display all the way to the top > as far as you can before the clear screen is issued. >=20 > 2. The scrollback history must be full. I.e., this > won't happen in a fresh cmd.exe window. First, print > thousands of lines of stuff to make the buffer "tall". > This is why it only started happening to me after some > amount of testing; I had filled the buffer. >=20 > 3. It's probably a necessary condition that there is additional > output immediately after the clear screen (such as the > programming language prompt being printed), because > the console scrolls to bottom on any output. >=20 > I'm not sure if these are sufficient, but they seem to be > on my end. I could reproduce this now and I think I have fixed it. There's still a problem with the position of the scrollbars in certain scenarios where they are off by about one window size. I added a FIXME comment. I have to admit I'm very puzzled that neither SetConsoleWindowInfo nor the subsequent SetConsoleCursorPosition automatically set the scrollbars correctly. That's what I would expect, naively. If anybody knows how to fix the scrollbar position in a Windows console without moving the window contents around, please help. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXoeZ3AAoJEPU2Bp2uRE+g32QP+wfbeaEeXBOU2Yf2U4fBTCfm K3rInH49LHjQvK19Xab1QzH74THX7XGZT45WUPC9ggcC5u+Jato1GdjjQlYCY0+H VKxTp2fzj8MZyqlzbz082LYrqv22R6H51u0lq2HpQy9XpooZ8d36eXrG0F1y99pk 45WMqCX5N+rXRm49eEnrdh5ujz30wc2H191ZtUKYBadPnqagPbPR/pnNxjUb5RYy /+zaT11n2SbiPxfrynz7YHwTKA2oi/wqUiLj4u/QxEUcGf5V+SVNTdQazG9jxDOh VeaVG8O/Xl4OMi/C0N+bbZLmyWuM+HjvY+B16jRzv1Gm5WxP1xZ10bWnLLudX8XV 9LeuD0laZQib5r4BwyUZ2bDQQ50Df7NhPY86Oy6N931nwEJsb+3/6xAXSutAV4tA ETlNzK7VtzZvje5MXWX3sE+acJHKzjR09U6GDxJhUasRNgyXXLNZ6imBDTgEBjRs 0mRLTOH+pZO3ebTkz+GwIWUYgBj6MovmjsCuSgDjvuZhbmHkAtsg1hHrE2KXi2wf MsZu+zDUsCFZqBZT9I0CA+KQt7hOdknhXp31rsx57gzyQLSyK83aTTNDChR7T1/d eIBt11FxoVzvU7CopFW8L5zmMBPQwZjT+DvYydSRVTihgpnC+Mb9qj8TP3M8hZFR Iw8dhhSUKkkRzTMPGEFN =yraG -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF--