Hack to use UseSystemConsole passed in the command line arguments.

This commit is contained in:
BDisp
2023-05-14 00:05:50 +01:00
parent 89234cbdd8
commit b74d11c786

View File

@@ -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) {