From 27b7143161ea0e68f7d30078675c45485356a42f Mon Sep 17 00:00:00 2001 From: Tigger Kindel Date: Wed, 19 Jul 2023 08:22:14 -0600 Subject: [PATCH] Took @bdisp's fix --- Terminal.Gui/ConsoleDrivers/NetDriver.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Terminal.Gui/ConsoleDrivers/NetDriver.cs b/Terminal.Gui/ConsoleDrivers/NetDriver.cs index 78ffb6fa3..b38f43df3 100644 --- a/Terminal.Gui/ConsoleDrivers/NetDriver.cs +++ b/Terminal.Gui/ConsoleDrivers/NetDriver.cs @@ -197,15 +197,11 @@ namespace Terminal.Gui { break; } } else if (consoleKeyInfo.KeyChar == (char)Key.Esc && isEscSeq) { - if (cki == null) { - // This is an error. We got an ESC while we're in an ESC sequence already - // but there's no record of the ESC sequence. - // Ignore this for now until we can figure out how we got in this state - isEscSeq = false; - } else { - DecodeEscSeq (ref newConsoleKeyInfo, ref key, cki, ref mod); - } + DecodeEscSeq (ref newConsoleKeyInfo, ref key, cki, ref mod); cki = null; + if (!Console.KeyAvailable) { + isEscSeq = false; + } break; } else { GetConsoleInputType (consoleKeyInfo);