From b74d11c7864fa6e20d40ef5cbead89a42f81ee5e Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 14 May 2023 00:05:50 +0100 Subject: [PATCH] Hack to use UseSystemConsole passed in the command line arguments. --- Terminal.Gui/Application.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Terminal.Gui/Application.cs b/Terminal.Gui/Application.cs index d697946ee..2f3ed5c82 100644 --- a/Terminal.Gui/Application.cs +++ b/Terminal.Gui/Application.cs @@ -153,6 +153,7 @@ namespace Terminal.Gui { internal static bool _initialized = false; internal static int _mainThreadId = -1; + private static bool? _useSystemConsole; // INTERNAL function for initializing an app with a Toplevel factory object, driver, and mainloop. // @@ -181,6 +182,9 @@ namespace Terminal.Gui { Driver = driver; } + // @tig this is a hack to restore the UseSystemConsole take from the args + _useSystemConsole = _useSystemConsole == null ? UseSystemConsole : _useSystemConsole; + // Start the process of configuration management. // Note that we end up calling LoadConfigurationFromAllSources // multiple times. We need to do this because some settings are only @@ -189,6 +193,10 @@ namespace Terminal.Gui { ConfigurationManager.Load (true); ConfigurationManager.Apply (); + if (UseSystemConsole != _useSystemConsole) { + UseSystemConsole = (bool)_useSystemConsole; + } + if (Driver == null) { var p = Environment.OSVersion.Platform; if (_forceFakeConsole) {