================
@@ -993,6 +996,20 @@ class IOHandlerProcessSTDIOWindows : public IOHandler {
case WAIT_FAILED:
goto exit_loop;
case WAIT_OBJECT_0: {
+ if (isConsole) {
+ INPUT_RECORD inputRecord;
+ DWORD numRead = 0;
+ if (!PeekConsoleInput(hStdin, &inputRecord, 1, &numRead) ||
+ numRead == 0)
+ goto exit_loop;
+ // We only care about text input. Ignore all non text input events
and
+ // let other IOHandlers handle them.
+ if (inputRecord.EventType != KEY_EVENT ||
+ !inputRecord.Event.KeyEvent.bKeyDown ||
+ inputRecord.Event.KeyEvent.uChar.AsciiChar == 0)
+ break;
----------------
Nerixyz wrote:
> My understanding is that we don't want to consume the non text console events
> and let another IOHandler handle them.
When we call `ReadFile`, do we consume the non-text events? I thought these
events are dropped there.
I wonder why the `ReadConsoleInput` approach doesn't work.
https://github.com/llvm/llvm-project/pull/175812
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits