================
@@ -993,6 +996,27 @@ class IOHandlerProcessSTDIOWindows : public IOHandler {
case WAIT_FAILED:
goto exit_loop;
case WAIT_OBJECT_0: {
+ if (isConsole) {
+ while (true) {
+ INPUT_RECORD inputRecord;
+ DWORD numRead = 0;
+ if (!PeekConsoleInput(hStdin, &inputRecord, 1, &numRead) ||
+ numRead == 0)
+ goto exit_loop;
----------------
Nerixyz wrote:
> I think this should never happen because `WaitForMultipleObjects` means there
> is data in the pipe right?
If there's no data in the pipe, that's true. But if there are _only_
non-keyboard events in it, we'll read them out and discard them (in the inner
loop). Once we drained the pipe, `PeekConsoleInput` will return `nRead = 0`.
https://github.com/llvm/llvm-project/pull/175812
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits