Browse Source

diagnosing netdriver wsl

Tigger Kindel 2 years ago
parent
commit
1f209098dd

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

@@ -657,16 +657,12 @@ internal class CursesDriver : ConsoleDriver {
 
 
 			Curses.StartColor ();
 			Curses.StartColor ();
 			Curses.UseDefaultColors ();
 			Curses.UseDefaultColors ();
-			Curses.CheckWinChange ();
 		}
 		}
 
 
 		CurrentAttribute = MakeColor (Color.White, Color.Black);
 		CurrentAttribute = MakeColor (Color.White, Color.Black);
 		InitializeColorSchemes ();
 		InitializeColorSchemes ();
 
 
-		ClearContents ();
-
 		TerminalResized = terminalResized;
 		TerminalResized = terminalResized;
-		StartReportingMouseMoves ();
 
 
 		if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX)) {
 		if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX)) {
 			Clipboard = new MacOSXClipboard ();
 			Clipboard = new MacOSXClipboard ();
@@ -679,7 +675,10 @@ internal class CursesDriver : ConsoleDriver {
 		}
 		}
 
 
 		if (_window != null) {
 		if (_window != null) {
+			Curses.CheckWinChange ();
+			ClearContents ();
 			Curses.refresh ();
 			Curses.refresh ();
+			StartReportingMouseMoves ();
 		}
 		}
 	}
 	}
 
 

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

@@ -3,6 +3,7 @@
 //
 //
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
 using System.Threading;
 using System.Threading;
@@ -554,7 +555,7 @@ internal class NetDriver : ConsoleDriver {
 	const int COLOR_BRIGHT_CYAN = 96;
 	const int COLOR_BRIGHT_CYAN = 96;
 	const int COLOR_BRIGHT_WHITE = 97;
 	const int COLOR_BRIGHT_WHITE = 97;
 
 
-	public override bool SupportsTrueColor => true;// Environment.OSVersion.Version.Build >= 14931;
+	public override bool SupportsTrueColor => Environment.OSVersion.Platform == PlatformID.Unix || (IsWinPlatform && Environment.OSVersion.Version.Build >= 14931);
 
 
 	public NetWinVTConsole NetWinConsole { get; private set; }
 	public NetWinVTConsole NetWinConsole { get; private set; }
 	public bool IsWinPlatform { get; private set; }
 	public bool IsWinPlatform { get; private set; }
@@ -617,6 +618,7 @@ internal class NetDriver : ConsoleDriver {
 			Rows = Console.WindowHeight;
 			Rows = Console.WindowHeight;
 		} else {
 		} else {
 			// Simluate
 			// Simluate
+			throw new InvalidOperationException ("blah");
 			Cols = 80;
 			Cols = 80;
 			Rows = 25;
 			Rows = 25;
 		}
 		}