[PATCH v8 0/7] Fix out-of-order keystrokes

Johannes Schindelin Johannes.Schindelin@gmx.de
Sat Mar 28 14:40:54 GMT 2026


Hi Takashi,

On Sat, 28 Mar 2026, Takashi Yano wrote:

> The reproducer that uses AutoHotKey provided by Johannes:
> https://cygwin.com/pipermail/cygwin-patches/2026q1/014714.html
> uncovered several issues regarding input transfer between nat-
> pipe and cyg-pipe. Most of the issues happen when non-cygwin
> shell start cygwin-app. This patch series addresses these issues.
> 
> v8: (changes from v7)
>   PATCH 1/7: Replace the commit message.
>   PATCH 2/7: Replace the commit message.
>              The handle h_pcon_in to retrieve console mode is
>              cached now to prevent calling OpenProcess() everytime.
>   PATCH 3/7: Replace the commit message.
>              Add NULL check for parent_pty_input_mutex.
>   PATCH 4/7: Replace the commit message.
>              Use tmp_pathbuf for the buffer to applying line_edit().

It's a bit of a strange thing to use a path buffer (that is meant to hold
an absolute path) in `line_edit()` (where it consumes input events instead
of a path), but hey, it works ;-)

>   PATCH 5/7: Replace the commit message. Add short comment as suggested.
>   PATCH 6/7: Replace the commit message.
>   PATCH 7/7: Replace the commit message.

Once again: Thank you for your hard work. I have spent quite the dozens of
hours pouring over the code (and that's nothing compared to the time I let
Claude Opus spend with it to guide me and to test hypotheses), so I know
how much work this was. I am thoroughly grateful!

I've integrated v8 (plus 2/7 fixup) into
https://github.com/git-for-windows/msys2-runtime/pull/124 and for good
measure threw in a test case for the Ctrl+H bug you worked around in 2/7.

Just to make it explicit: I think that, unless you want to let it simmer
for a bit first, this iteration could be pushed as-is (noting that
"Cygwin: pty: Fix input transfer when multiple non-cygwin apps exist"
should probably go first so that the patches apply cleanly, and noting
that a backport to the `cygwin-3_6-branch` would also require 699c6892f1
(Cygwin: pty: Fix nat pipe hand-over when pcon is disabled, 2026-03-03)
and 9ef8e3ad3b (Cygwin: console: Release pipe_sw_mutex in
pcon_hand_over_proc(), 2026-03-24) to be backported).

Thanks!
Johannes


More information about the Cygwin-patches mailing list