Browse Source

fixed WindowsDriver to work in linux unit tests

Tigger Kindel 2 years ago
parent
commit
9c0bfd1478
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

+ 4 - 1
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

@@ -795,7 +795,10 @@ internal class WindowsDriver : ConsoleDriver {
 
 	public WindowsDriver ()
 	{
-		WinConsole = new WindowsConsole ();
+		if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
+			WinConsole = new WindowsConsole ();
+			// otherwise we're probably running in unite tests
+		}
 		Clipboard = new WindowsClipboard ();
 
 		_isWindowsTerminal = Environment.GetEnvironmentVariable ("WT_SESSION") != null;