diff --git a/Terminal.Gui/Core/Application.cs b/Terminal.Gui/Core/Application.cs index 040ddba4a..9e4003c9f 100644 --- a/Terminal.Gui/Core/Application.cs +++ b/Terminal.Gui/Core/Application.cs @@ -161,6 +161,9 @@ namespace Terminal.Gui { internal static bool _initialized = false; + static IMainLoopDriver oldMainLoopDriver; + static ConsoleDriver oldDriver; + /// /// Initializes the Terminal.Gui application /// @@ -189,8 +192,15 @@ namespace Terminal.Gui { mainLoopDriver = windowsDriver; Driver = windowsDriver; } else { - mainLoopDriver = new UnixMainLoop (); - Driver = new CursesDriver (); + if (oldMainLoopDriver == null && oldDriver == null) { + mainLoopDriver = new UnixMainLoop (); + Driver = new CursesDriver (); + oldMainLoopDriver = mainLoopDriver; + oldDriver = Driver; + } else { + mainLoopDriver = oldMainLoopDriver; + Driver = oldDriver; + } } Driver.Init (TerminalResized); MainLoop = new MainLoop (mainLoopDriver);