Browse Source

No need to throw if after all a valid console is preserved.

BDisp 2 years ago
parent
commit
509a8d15c7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Terminal.Gui/ConsoleDrivers/WindowsDriver.cs

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

@@ -252,7 +252,8 @@ namespace Terminal.Gui {
 			}
 			var winRect = new SmallRect (0, 0, (short)(newCols - 1), (short)Math.Max (newRows - 1, 0));
 			if (!SetConsoleWindowInfo (OutputHandle, true, ref winRect)) {
-				throw new System.ComponentModel.Win32Exception (Marshal.GetLastWin32Error ());
+				//throw new System.ComponentModel.Win32Exception (Marshal.GetLastWin32Error ());
+				return new Size (cols, rows);
 			}
 			SetConsoleOutputWindow (csbi);
 			return new Size (winRect.Right + 1, newRows - 1 < 0 ? 0 : winRect.Bottom + 1);