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: [ANNOUNCEMENT] Updated: libreadline7-7.0.3-3


On Jul 31 22:01, Corinna Vinschen wrote:
> On Jul 31 14:36, David Macek wrote:
> > On 31. 7. 2017 11:48, Corinna Vinschen wrote:
> > > Well, it works for me.  I tested this in tcsh, bash and od on
> > > Windows 10.
> > 
> > I tested on Windows 2012 R2 (8.1 equivalent) and I can confirm
> > Steven's findings.  Tried with an older installation and then once
> > more after a complete update (`uname -a`s below).
> > [...]
> Further debugging shows that Alt-Numpad doesn't work on Windows 7
> because the OS doesn't return the required information.
> 
> Huh?  Why then does it look like only bash is affected?
> 
> Other tools, including tcsh, just read from the console, which means,
> only calling ReadConsoleInput under Cygwin's hood.  Readline on the
> other hand, uses select.  Select in turn uses the Windows function
> PeekConsoleInput.
> 
> And as far as I can tell, PeekConsoleInput has a bug in terms of CP
> 65001 on W7.  After lifting the left ALT key, PeekConsoleInput reads an
> input event for the key up event.  If this is the end of a Alt-Numpad
> sequence, the event contains the resulting unicode character.  But not
> so if the codepage is 65001.  In this case the returned unicode
> character has the value 0.  And a subsequent call to ReadConsoleInput
> will also get a unicode char value of 0.
> 
> As far as I can see there's no way around this, [...]

Ahhhhh, no, no, no.  I found the problem.  When using CP 65001 on
pre-W10, you *must not* use the ANSI functions PeekConsoleInputA and
ReadConsoleInputA, but select() was still using them as it did so for
ages.

Now using the UNICODE functions PeekConsoleInputW and ReadConsoleInputW,
select is doing the right thing even with CP 65001.

I applied a patch and uploaded new developer snapshots to
https://cygwin.com/snapshots/


Please test,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


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