浏览代码

Enable Driver.Suspend for NetDriver using Unix.

BDisp 1 年之前
父节点
当前提交
1e7263be73
共有 1 个文件被更改,包括 17 次插入3 次删除
  1. 17 3
      Terminal.Gui/ConsoleDrivers/NetDriver.cs

+ 17 - 3
Terminal.Gui/ConsoleDrivers/NetDriver.cs

@@ -852,11 +852,25 @@ internal class NetDriver : ConsoleDriver
         { }
     }
 
-    #region Not Implemented
+    public override void Suspend ()
+    {
+        if (Environment.OSVersion.Platform != PlatformID.Unix)
+        {
+            return;
+        }
 
-    public override void Suspend () { throw new NotImplementedException (); }
+        StopReportingMouseMoves ();
 
-    #endregion
+        if (!RunningUnitTests)
+        {
+            Console.ResetColor ();
+            Console.Clear ();
+            Platform.Suspend ();
+            Application.Refresh ();
+        }
+
+        StartReportingMouseMoves ();
+    }
 
     public override void UpdateScreen ()
     {