From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41462 invoked by alias); 19 Jan 2017 14:21:52 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 41447 invoked by uid 89); 19 Jan 2017 14:21:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=pressed, H*f:sk:102fbd6, H*i:sk:102fbd6, H*MI:sk:102fbd6 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Jan 2017 14:21:41 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF95E3B470 for ; Thu, 19 Jan 2017 14:21:40 +0000 (UTC) Received: from [10.10.117.52] (ovpn-117-52.rdu2.redhat.com [10.10.117.52]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0JELe2C009376 for ; Thu, 19 Jan 2017 09:21:40 -0500 Subject: Re: [ANNOUNCEMENT] Updated: libreadline7-7.0.1-1, libreadline-devel-7.0.1-1, bash-4.4.5-1 To: cygwin@cygwin.com References: <587f00e3.072c9d0a.867a0.d29e@mx.google.com> <58804d14.26149d0a.21734.79aa@mx.google.com> <102fbd64-1bc2-41ee-63d2-932a81124b75@cs.umass.edu> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Message-ID: <9b15fb8f-7925-a963-0947-51dfe68d4058@redhat.com> Date: Thu, 19 Jan 2017 14:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <102fbd64-1bc2-41ee-63d2-932a81124b75@cs.umass.edu> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BPjsCRN12PXVJWS0XWlVFT8PhgQv5wkCO" X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00253.txt.bz2 --BPjsCRN12PXVJWS0XWlVFT8PhgQv5wkCO Content-Type: multipart/mixed; boundary="Rx1IIIAASkVgt7a76UtXLS07DUiFrnL5S"; protected-headers="v1" From: Eric Blake To: cygwin@cygwin.com Message-ID: <9b15fb8f-7925-a963-0947-51dfe68d4058@redhat.com> Subject: Re: [ANNOUNCEMENT] Updated: libreadline7-7.0.1-1, libreadline-devel-7.0.1-1, bash-4.4.5-1 References: <587f00e3.072c9d0a.867a0.d29e@mx.google.com> <58804d14.26149d0a.21734.79aa@mx.google.com> <102fbd64-1bc2-41ee-63d2-932a81124b75@cs.umass.edu> In-Reply-To: <102fbd64-1bc2-41ee-63d2-932a81124b75@cs.umass.edu> --Rx1IIIAASkVgt7a76UtXLS07DUiFrnL5S Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2381 On 01/19/2017 07:23 AM, Eliot Moss wrote: >> I have root caused this. With the new readline, running ./configure > creates >> config.h, as expected. However new version adds this line: >> >> #define HAVE_PSELECT 1 >> >> If you remove this from config.h, then make, the resultant DLL behaves > as it did >> with previous readline. Not sure what is causing this change, I will > try to dig >> into it more. >=20 > You probably found it, but here's why they added use of pselect: >=20 > "h. Use pselect(2), if available, to wait for input before calling > read(2), so > a SIGWINCH can interrupt it, since it doesn't interrupt read(2)." >=20 > Of course that does not explain why it's not working how we would like ... Here's my guess - cygwin1.dll has an incomplete implementation of pselect on Windows consoles when it comes to capturing ALT-numkeypad sequences. Probably something to do with the fact that it takes multiple keystrokes before a single character is supposed to be recognized, which means you have to make a decision after each key state change event whether a character is complete or not. Under the old code, when pselect was not in use, readline just used read() until a character showed up (but blocked in doing so, and risked SIGWINCH issues); now readline can use pselect() and sees that a key has been pressed, except that there is no input available until several more keys are pressed and a key released. I'm no expert in the windows console handling code in cygwin1.dll, but if you are correct that the use (or absence) of HAVE_PSELECT in modern readline makes a difference, then it sounds like we have two things to do: first, I will rebuild readline with a patch to avoid pselect() (the behavior of readline will be riskier, and may break under SIGWINCH, but at least that is no worse than it was with the old readline), meanwhile, someone with more expertise in the console handling code will need a boiled-down testcase (probably a simple .c program that compares a straight read() with a pselect() loop that decides when to read()) to see if they can fix the handling of ALT-numkeypad entries under the console in cygwin1.dll. Once a fixed cygwin1.dll is available, then I can re-release a version of readline built with HAVE_PSELECT. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Rx1IIIAASkVgt7a76UtXLS07DUiFrnL5S-- --BPjsCRN12PXVJWS0XWlVFT8PhgQv5wkCO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 604 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYgMtyAAoJEKeha0olJ0NqWBgH/0WeOjPNARrPv8MDBtrZh+tk gzBf0mn7+7DAjYp3yAij4qBk0QG8IKWpaoi46mXAwukHVSZhh2LP+c9XvActPK5E /HnyqTjqSIrFycfMHDt7vbw4u23eenYRP16tno/qP0FQCXs46KQWuV0iCkREWOYA i/VwCbo0BPDgkz2hxExtX3jv7xVyhnCHzCvEEdg/Wpnv9DorNWXV/gc6sjy/sFUc rQ8vy5MtBujARu990vmTR8mGLUwnxTW5R+UhieI4ugx5iCccVZ6OR6p4FdUu4BK/ ofyCziecz9v7XBSlRdrX4ws35GjUkrozDJFcGPbT2sKcpWJMDMzA2JLsF0FS4X4= =kxPK -----END PGP SIGNATURE----- --BPjsCRN12PXVJWS0XWlVFT8PhgQv5wkCO--