Explorar o código

Use Curses.flushinp to throws away any typeahead.

BDisp %!s(int64=2) %!d(string=hai) anos
pai
achega
281f470aa4
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

+ 3 - 4
Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

@@ -160,10 +160,9 @@ namespace Terminal.Gui {
 			StopReportingMouseMoves ();
 			SetCursorVisibility (CursorVisibility.Default);
 
-			var code = Curses.get_wch (out _);
-			while (code != -1) {
-				code = Curses.get_wch (out _);
-			}
+			// throws away any typeahead that has been typed by
+			// the user and has not yet been read by the program.
+			Curses.flushinp ();
 
 			Curses.endwin ();
 		}