From b6fff4382466322ff62254dd6723b091ca30eec6 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 19 Oct 2025 21:41:22 +0100 Subject: [PATCH] Prevents unnecessary noise log errors on unit tests (#4294) * Prevents unnecessary noise log errors on unit tests * Prevent any code in the Peek method --- Terminal.Gui/Drivers/WindowsDriver/WindowsInput.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Terminal.Gui/Drivers/WindowsDriver/WindowsInput.cs b/Terminal.Gui/Drivers/WindowsDriver/WindowsInput.cs index 6207e1886..94f2c5ec8 100644 --- a/Terminal.Gui/Drivers/WindowsDriver/WindowsInput.cs +++ b/Terminal.Gui/Drivers/WindowsDriver/WindowsInput.cs @@ -61,6 +61,11 @@ internal class WindowsInput : ConsoleInput, IWindowsInput protected override bool Peek () { + if (ConsoleDriver.RunningUnitTests) + { + return false; + } + const int bufferSize = 1; // We only need to check if there's at least one event nint pRecord = Marshal.AllocHGlobal (Marshal.SizeOf () * bufferSize);