Typed characters are mis-ordered when CPU usage is high
Takashi Yano
takashi.yano@nifty.ne.jp
Fri Mar 18 12:15:22 GMT 2022
On Fri, 18 Mar 2022 13:21:00 +0200
Orgad Shaneh wrote:
> > Git for Windows
>
> Were you able to reproduce?
>
> I found an easier way to reproduce, which works almost every time.
>
> It still happens only on Git Bash, and not on MSYS2 MINGW64, although
> I use the same dll in both. I have no idea why there's a difference.
> :/
>
> I run Windows Terminal, but it reproduces also in cmd, as you tried.
>
> 1. In Control Panel -> Keyboard, set Repeat delay to shortest and
> Repeat rate to fastest.
> 2. In msys2-runtime run git fetch
> 3. Type git and press and hold q
Thanks. I can reproduce the issue. I think I found the cause.
The two unexpected things happen.
(1) wVirtualKeyCode and wVirtualScanCode of readback key event may
be null'ed even if they are not zero on WriteConsoleInputW().
Therefore, memcmp() report the event is not equal.
(2) WriteConsoleInputW() may not be atomic. The event sequence which
is written by WriteConsoleInputW() may be inserted by key input
in the middle of the sequence.
A patch for these issues is attached. Could you please test?
--
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prevent-swap.patch
Type: application/octet-stream
Size: 2884 bytes
Desc: not available
URL: <https://cygwin.com/pipermail/cygwin/attachments/20220318/c14b78e5/attachment.obj>
More information about the Cygwin
mailing list