mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 16:58:01 +01:00
Fixes #3518. v1 NetDriver throws System.InvalidOperationException when a key is pressed.
This commit is contained in:
@@ -177,7 +177,15 @@ namespace Terminal.Gui {
|
||||
ConsoleKeyInfo newConsoleKeyInfo = default;
|
||||
|
||||
while (true) {
|
||||
ConsoleKeyInfo consoleKeyInfo = Console.ReadKey (true);
|
||||
ConsoleKeyInfo consoleKeyInfo;
|
||||
|
||||
try {
|
||||
consoleKeyInfo = Console.ReadKey (true);
|
||||
} catch (InvalidOperationException ex) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ((consoleKeyInfo.KeyChar == (char)Key.Esc && !isEscSeq)
|
||||
|| (consoleKeyInfo.KeyChar != (char)Key.Esc && isEscSeq)) {
|
||||
if (cki == null && consoleKeyInfo.KeyChar != (char)Key.Esc && isEscSeq) {
|
||||
|
||||
Reference in New Issue
Block a user