I raised the same question under: https://github.com/microsoft/terminal/issues/17824
*cons_master_thread() should *possibly maintain a local key cache and not push back events. Alternatively, from research these pseudo key events have Vk=0/Sc=0 values (only char and down are set); as such peek the console input queue and don't process the input stream if detected. Note, WriteInputConsole is now considered as a *wrong-way verb <https://learn.microsoft.com/en-us/windows/console/console-buffer-security-and-access-rights#wrong-way-verbs>* for this buffer. Applications remoting via cross-platform utilities and transports like SSH may not work as expected if using this API https://learn.microsoft.com/en-us/windows/console/writeconsoleinput On Sat, Aug 31, 2024 at 1:20 PM Takashi Yano <takashi.y...@nifty.ne.jp> wrote: > Thanks for the pointer. Unfortunately, the document does not mention > about the behaviour of WriteConsoleInput() in the win32-inpu-mode. > > I expected that ReadConsoleInput() returns the INPUT_RECORDS which > WriteConsoleInput() sends. However, that does not seem true in this > mode. > > On Sat, 31 Aug 2024 12:24:46 +0800 > Adamyg Mob wrote: > > *One suspect is the fhandler_console::cons_master_thread (), which > > attempts to mine signals within the input stream; yet it may not handle a > > single key being represented by multiple events.*; furthermore one of the > > few uses of WriteConsoleInput > > Is there any means of disabling the feature for testing? > > There is no other means than modifying the source code of cygwin1.dll > and rebuild it. I already tried that and the problem disappeard. > > -- > Takashi Yano <takashi.y...@nifty.ne.jp> > -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple