From ef70314add0ed2dc21aec090801c1a510866904a Mon Sep 17 00:00:00 2001 From: js6pak Date: Mon, 23 May 2022 23:18:19 +0200 Subject: [PATCH] Support macos --- BepInEx.Core/Console/Windows/ConsoleWindow.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BepInEx.Core/Console/Windows/ConsoleWindow.cs b/BepInEx.Core/Console/Windows/ConsoleWindow.cs index d08f051..dbf1855 100644 --- a/BepInEx.Core/Console/Windows/ConsoleWindow.cs +++ b/BepInEx.Core/Console/Windows/ConsoleWindow.cs @@ -64,7 +64,10 @@ internal class ConsoleWindow var currWnd = getForeground(); if (!AllocConsole()) - throw new Win32Exception("AllocConsole() failed"); + { + var error = Marshal.GetLastWin32Error(); + if (error != 5) throw new Win32Exception("AllocConsole() failed"); + } // Restore Foreground setForeground(currWnd);