瀏覽代碼

Merge branch 'master' into fix_763_incorrect_wordwrap

Charlie Kindel 5 年之前
父節點
當前提交
3c7fa75c0b
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      Terminal.Gui/Core/Application.cs

+ 12 - 2
Terminal.Gui/Core/Application.cs

@@ -161,6 +161,9 @@ namespace Terminal.Gui {
 
 		internal static bool _initialized = false;
 
+		static IMainLoopDriver oldMainLoopDriver;
+		static ConsoleDriver oldDriver;		
+
 		/// <summary>
 		/// Initializes the Terminal.Gui application
 		/// </summary>
@@ -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);