瀏覽代碼

Took @bdisp's fix

Tigger Kindel 2 年之前
父節點
當前提交
27b7143161
共有 1 個文件被更改,包括 3 次插入7 次删除
  1. 3 7
      Terminal.Gui/ConsoleDrivers/NetDriver.cs

+ 3 - 7
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
+					DecodeEscSeq (ref newConsoleKeyInfo, ref key, cki, ref mod);
+					cki = null;
+					if (!Console.KeyAvailable) {
 						isEscSeq = false;
-					} else {
-						DecodeEscSeq (ref newConsoleKeyInfo, ref key, cki, ref mod);
 					}
-					cki = null;
 					break;
 				} else {
 					GetConsoleInputType (consoleKeyInfo);