Use Curses.flushinp to throws away any typeahead.

This commit is contained in:
BDisp
2023-08-07 18:34:01 +01:00
committed by Tig
parent c6b5ada5c4
commit 281f470aa4

View File

@@ -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 ();
}