Skip to content

Commit 731b721

Browse files
CopilottigtznindCopilot
authored andcommitted
Remove legacy drivers, simplify architecture, and reorganize codebase structure (gui-cs#4270)
* Initial plan * Remove legacy drivers and reorganize v2 architecture Co-authored-by: tig <585482+tig@users.noreply.github.com> * Extract Windows key helper utilities and fix build Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix all test references to legacy drivers Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update documentation to reflect new driver architecture Co-authored-by: tig <585482+tig@users.noreply.github.com> * Remove V2.cd diagram file Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix test failures: support legacy drivers and update exception handling Co-authored-by: tig <585482+tig@users.noreply.github.com> * updated driver names * Move V2 tests from ConsoleDrivers/V2 to proper locations Co-authored-by: tig <585482+tig@users.noreply.github.com> * Rename ApplicationV2 to ModernApplicationImpl to remove v2 terminology Co-authored-by: tig <585482+tig@users.noreply.github.com> * Remove V2 terminology from test drivers and FakeDriver classes Co-authored-by: tig <585482+tig@users.noreply.github.com> * Merge ModernApplicationImpl into ApplicationImpl and move to App folder Co-authored-by: tig <585482+tig@users.noreply.github.com> * Create modern FakeDriver with component factory architecture in Terminal.Gui project Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor: Move non-platform-dependent code from /Drivers to /App Co-authored-by: tig <585482+tig@users.noreply.github.com> * Code cleanup and org * Unit test reorg * Refactor MainLoop architecture: rename classes and enhance documentation for clarity Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add comprehensive FakeDriver tests (WIP - some tests need fixes) Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fixed FakeDriver build failures * Fix all FakeDriver test failures - Application.Top creation and clipboard behaviors Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fixed FakeDriver build failures2 * Remove hanging legacy FakeDriver tests that use Console.MockKeyPresses Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fixed some tests * Fixed more tests * Fixed more tests * Fix bad copilot (gui-cs#4277) * Update Terminal.Gui/Drivers/FakeDriver/FakeConsoleOutput.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor Application Init and Update Tests Refactored `Application.Init` to improve initialization logic: - Added fallback to `ForceDriver` when `driverName` is null. - Changed repeated `Init` calls to throw `InvalidOperationException`. - Updated `_driverName` assignment logic for robustness. Enhanced `IConsoleDriver` with detailed remarks on implementations. Revised test cases to align with updated `Application.Init` behavior: - Replaced `FakeDriver` with `null` and `driverName: "fake"`. - Skipped or commented out tests incompatible with new logic. - Improved formatting and removed redundant setup code. Improved code style and consistency across the codebase: - Standardized parameter formatting and spacing. - Removed outdated comments and unused code. General cleanup to enhance readability and maintainability. * Warp fix copilot (gui-cs#4278) * More fixes (gui-cs#4279) * Fixes/works around test failures and temporarily disable failing test Updated `FakeDriver` to set `RunningUnitTests` to `true` and initialize dimensions using `FakeConsole`. Modified `TestRespondersDisposedAttribute` to set `ConsoleDriver.RunningUnitTests` in the `Before` method, ensuring proper behavior during unit tests. Temporarily disabled the `Button_CanFocus_False_Raises_Accepted_Correctly` test in `ViewCommandTests` by adding a `Skip` parameter to the `[Fact]` attribute, referencing issue gui-cs#4270. * Allow all tests to run despite failures in UnitTests Modified the `dotnet test` command in the `Run UnitTestsParallelizable` step to set `xunit.stopOnFail` to `false`. This ensures that the test runner does not stop execution on the first failure, allowing all tests to execute regardless of individual test outcomes. * Refactor ApplicationScreenTests for cleaner setup/teardown Refactored `ClearContents_Called_When_Top_Frame_Changes` test: - Added `[AutoInitShutdown]` attribute for automatic lifecycle management. - Replaced manual `Application.Init` and `Application.Top` setup with `Application.Begin` and `RunState`. - Simplified event handling by defining `ClearedContents` handler inline. - Removed explicit cleanup logic, relying on `Application.End` for teardown. Updated `using` directives to include `UnitTests` namespace. * Attempt to fix intermittent local test failures. Update ApplicationImpl initialization parameter Changed the second parameter of the `impl.Init` method in the `FakeApplicationFactory` class from `"dotnet"` to `"fake"`. * Code cleanup to cause Action to re-run. * Stop tests on first failure in UnitTestsParallelizable Updated the `dotnet test` command in `unit-tests.yml` to set the `xunit.stopOnFail` parameter to `true`. This change ensures that test execution halts immediately upon encountering a failure, allowing quicker identification and resolution of issues. Note that this may prevent the full test suite from running in the event of a failure. * Allow all tests to run despite failures in CI Updated `unit-tests.yml` to set `xunit.stopOnFail` to `false` in both `Run UnitTests` and `Run UnitTestsParallelizable` steps. This ensures that the test runner does not stop execution on the first test failure, allowing all tests to complete even if some fail. * Enhance RuneExtensions docs and update user dictionary Updated the `<remarks>` section in `RuneExtensions.GetColumns` to include details about the `wcwidth` implementation and improved readability with `<para>` tags. Added `wcwidth` to the user dictionary in `Terminal.sln.DotSettings` to avoid spelling errors. * Improve XML doc formatting in RuneExtensions.cs Updated the remarks section of the `GetColumns` method in the `RuneExtensions` class to enhance readability by reformatting and properly indenting `<para>` tags. The content remains unchanged, describing the method's implementation via `wcwidth` and its role as a Terminal.Gui extension for `System.Text.Rune`. * Refactor drivers and improve clipboard handling Replaced legacy drivers (`CursesDriver`, `NetDriver`) with `UnixDriver` and `DotNetDriver` across the codebase, including comments, method names, and test cases. Updated documentation and remarks to reflect the new driver names and platforms. Revamped clipboard handling with new platform-specific implementations: `UnixClipboard` for Unix, `MacOSXClipboard` for macOS, and `WSLClipboard` for Linux under WSL. Removed the old `CursesClipboard` and consolidated clipboard logic. Updated test cases to align with the new drivers and clipboard implementations. Improved naming consistency and cleaned up redundant code. Updated the README and documentation to reflect these changes. * Remove `PlatformColor` from `Attribute` struct This commit removes the `PlatformColor` property from the `Attribute` struct, simplifying the codebase by eliminating platform-specific color handling. The following changes were made: - Removed `PlatformColor` from the `Attribute` struct, including its initialization, usage, and related comments. - Updated constructors to no longer initialize or use `PlatformColor`. - Modified `Equals` and `GetHashCode` methods to exclude `PlatformColor`. - Updated `UnixComponentFactory` documentation to remove references to "v2unix." - Renamed `v2TestDriver` to `testDriver` in the `With` class for clarity. - Removed `PlatformColor` references in `DriverAssert` and related error messages. - Deleted test cases in `AttributeTests` that relied on `PlatformColor`. - Cleaned up comments and TODOs related to `PlatformColor` and `UnixDriver`. These changes reflect a shift away from platform-dependent color management, improving code clarity and reducing complexity. Remove `PlatformColor` and simplify `Attribute` logic The `PlatformColor` property has been removed from the `Attribute` struct, along with its associated logic, simplifying the codebase and eliminating platform-specific dependencies. Constructors, equality checks, and hash code generation in `Attribute` have been updated accordingly. The `CurrentAttribute` property in `ConsoleDriver` and `OutputBuffer` has been simplified, removing dependencies on `Application.Driver`. The `MakeColor` method logic has been removed or simplified in related classes. Tests in `AttributeTests` have been refactored to reflect these changes, focusing on `Foreground`, `Background`, and `Style`. Unix-specific logic tied to `PlatformColor` has been eliminated. Additional updates include renaming parameters in the `With` class for clarity, simplifying `DriverAssert` output, and performing minor code cleanups to improve readability and maintainability. * Refactor Terminal.Gui driver architecture for v2 Updated documentation to reflect the new modular driver architecture in Terminal.Gui v2. - Revised `namespace-drivers.md` to include new components (`IConsoleInput`, `IConsoleOutput`, `IInputProcessor`, `IOutputBuffer`, `IWindowSizeMonitor`) and terminal size monitoring. - Replaced "Key Components" with "Architecture Overview" and added details on the **Component Factory** pattern. - Documented the four driver implementations (`DotNetDriver`, `WindowsDriver`, `UnixDriver`, `FakeDriver`) and their platform-specific optimizations. - Added a "Threading Model" section to explain the multi-threaded design for responsive input handling. - Updated examples to demonstrate driver capabilities and explicit driver selection. In `drivers.md`: - Expanded the "Overview" to emphasize the modular, component-based architecture. - Reorganized "Drivers" into "Available Drivers" and added details on `FakeDriver` for unit testing. - Added sections on "Initialization Flow," "Shutdown Flow," and platform-specific driver details. - Provided examples for accessing driver components and creating custom drivers. In `index.md`: - Updated "Cross Platform" feature to reflect new driver names and clarified compatibility with SSH and monochrome terminals. * Moved files around --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com> Co-authored-by: Thomas Nind <31306100+tznind@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fe848d2 commit 731b721

File tree

188 files changed

+2308
-7424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+2308
-7424
lines changed

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050

5151
- name: Run UnitTests
5252
run: |
53-
dotnet test Tests/UnitTests --no-build --verbosity normal --collect:"XPlat Code Coverage" --settings Tests/UnitTests/coverlet.runsettings --diag:logs/UnitTests/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=true
53+
dotnet test Tests/UnitTests --no-build --verbosity normal --collect:"XPlat Code Coverage" --settings Tests/UnitTests/coverlet.runsettings --diag:logs/UnitTests/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=false
5454
5555
# mv -v Tests/UnitTests/TestResults/*/*.* TestResults/UnitTests/
5656

@@ -102,7 +102,7 @@ jobs:
102102

103103
- name: Run UnitTestsParallelizable
104104
run: |
105-
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal --collect:"XPlat Code Coverage" --settings Tests/UnitTestsParallelizable/coverlet.runsettings --diag:logs/UnitTestsParallelizable/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=true
105+
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal --collect:"XPlat Code Coverage" --settings Tests/UnitTestsParallelizable/coverlet.runsettings --diag:logs/UnitTestsParallelizable/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=false
106106
107107
# mv -v Tests/UnitTestsParallelizable/TestResults/*/*.* TestResults/UnitTestsParallelizable/
108108

Examples/Example/Example.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
using Attribute = Terminal.Gui.Drawing.Attribute;
1212

1313
// Override the default configuration for the application to use the Light theme
14-
ConfigurationManager.RuntimeConfig = """{ "Theme": "Light" }""";
14+
//ConfigurationManager.RuntimeConfig = """{ "Theme": "Light" }""";
1515
ConfigurationManager.Enable(ConfigLocations.All);
1616

17+
18+
1719
Application.Run<ExampleWindow> ().Dispose ();
1820

1921
// Before the application exits, reset Terminal.Gui for clean shutdown
@@ -89,5 +91,22 @@ public ExampleWindow ()
8991

9092
// Add the views to the Window
9193
Add (usernameLabel, userNameText, passwordLabel, passwordText, btnLogin);
94+
95+
ListView lv = new ListView ()
96+
{
97+
Y = Pos.AnchorEnd(),
98+
Height= Dim.Auto(),
99+
Width = Dim.Auto()
100+
};
101+
lv.SetSource (["One", "Two", "Three", "Four"]);
102+
Add (lv);
103+
}
104+
105+
public override void EndInit ()
106+
{
107+
base.EndInit ();
108+
// Set the theme to "Anders" if it exists, otherwise use "Default"
109+
ThemeManager.Theme = ThemeManager.GetThemeNames ().FirstOrDefault (x => x == "Anders") ?? "Default";
92110
}
93111
}
112+

Examples/UICatalog/Properties/launchSettings.json

Lines changed: 22 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,30 @@
44
"commandName": "Project",
55
"commandLineArgs": "--debug-log-level Debug"
66
},
7-
"UICatalog --driver NetDriver": {
7+
"UICatalog --driver windows": {
88
"commandName": "Project",
9-
"commandLineArgs": "--driver NetDriver"
9+
"commandLineArgs": "--driver windows -dl Trace"
1010
},
11-
"UICatalog --driver WindowsDriver": {
11+
"UICatalog --driver dotnet": {
1212
"commandName": "Project",
13-
"commandLineArgs": "--driver WindowsDriver"
14-
},
15-
"UICatalog --driver v2": {
16-
"commandName": "Project",
17-
"commandLineArgs": "--driver v2 -dl Trace"
18-
},
19-
"UICatalog --driver v2win": {
20-
"commandName": "Project",
21-
"commandLineArgs": "--driver v2win -dl Trace"
22-
},
23-
"UICatalog --driver v2net": {
24-
"commandName": "Project",
25-
"commandLineArgs": "--driver v2net -dl Trace"
13+
"commandLineArgs": "--driver dotnet -dl Trace"
2614
},
2715
"WSL: UICatalog": {
2816
"commandName": "Executable",
2917
"executablePath": "wsl",
3018
"commandLineArgs": "dotnet UICatalog.dll",
3119
"distributionName": ""
3220
},
33-
"WSL: UICatalog --driver NetDriver": {
34-
"commandName": "Executable",
35-
"executablePath": "wsl",
36-
"commandLineArgs": "dotnet UICatalog.dll --driver NetDriver",
37-
"distributionName": ""
38-
},
39-
"WSL: UICatalog --driver v2": {
40-
"commandName": "Executable",
41-
"executablePath": "wsl",
42-
"commandLineArgs": "dotnet UICatalog.dll --driver v2",
43-
"distributionName": ""
44-
},
45-
"WSL: UICatalog --driver v2unix": {
21+
"WSL: UICatalog --driver dotnet": {
4622
"commandName": "Executable",
4723
"executablePath": "wsl",
48-
"commandLineArgs": "dotnet UICatalog.dll --driver v2unix",
24+
"commandLineArgs": "dotnet UICatalog.dll --driver dotnet",
4925
"distributionName": ""
5026
},
51-
"WSL: UICatalog --driver v2net": {
27+
"WSL: UICatalog --driver unix": {
5228
"commandName": "Executable",
5329
"executablePath": "wsl",
54-
"commandLineArgs": "dotnet UICatalog.dll --driver v2net",
30+
"commandLineArgs": "dotnet UICatalog.dll --driver unix",
5531
"distributionName": ""
5632
},
5733
"WSL-Gnome: UICatalog": {
@@ -60,68 +36,46 @@
6036
"commandLineArgs": "bash -c 'while [ ! -e \"$XDG_RUNTIME_DIR/bus\" ]; do sleep 0.1; done; gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll; exec bash\"'",
6137
"distributionName": ""
6238
},
63-
"WSL-Gnome: UICatalog --driver NetDriver": {
39+
"WSL-Gnome: UICatalog --driver dotnet": {
6440
"commandName": "Executable",
6541
"executablePath": "wsl",
66-
"commandLineArgs": "bash -c 'while [ ! -e \"$XDG_RUNTIME_DIR/bus\" ]; do sleep 0.1; done; gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll --driver NetDriver; exec bash\"'",
42+
"commandLineArgs": "bash -c 'while [ ! -e \"$XDG_RUNTIME_DIR/bus\" ]; do sleep 0.1; done; gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll --driver dotnet; exec bash\"'",
6743
"distributionName": ""
6844
},
69-
"WSL-Gnome: UICatalog --driver v2": {
45+
"WSL-Gnome: UICatalog --driver unix": {
7046
"commandName": "Executable",
7147
"executablePath": "wsl",
72-
"commandLineArgs": "bash -c 'dbus-run-session -- gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll --driver v2; exec bash\"'",
73-
"distributionName": ""
74-
},
75-
"WSL-Gnome: UICatalog --driver v2unix": {
76-
"commandName": "Executable",
77-
"executablePath": "wsl",
78-
"commandLineArgs": "bash -c 'dbus-run-session -- gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll --driver v2unix; exec bash\"'",
79-
"distributionName": ""
80-
},
81-
"WSL-Gnome: UICatalog --driver v2net": {
82-
"commandName": "Executable",
83-
"executablePath": "wsl",
84-
"commandLineArgs": "bash -c 'dbus-run-session -- gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll --driver v2net; exec bash\"'",
48+
"commandLineArgs": "bash -c 'dbus-run-session -- gnome-terminal --wait -- bash -l -c \"dotnet UICatalog.dll --driver unix; exec bash\"'",
8549
"distributionName": ""
8650
},
8751
"Benchmark All": {
8852
"commandName": "Project",
8953
"commandLineArgs": "--benchmark"
9054
},
91-
"Benchmark All --driver NetDriver": {
92-
"commandName": "Project",
93-
"commandLineArgs": "--driver NetDriver --benchmark"
94-
},
95-
"Benchmark All --driver v2win": {
55+
"Benchmark All --driver dotnet": {
9656
"commandName": "Project",
97-
"commandLineArgs": "--driver v2win --benchmark"
57+
"commandLineArgs": "--driver dotnet --benchmark"
9858
},
99-
"Benchmark All --driver v2net": {
59+
"Benchmark All --driver windows": {
10060
"commandName": "Project",
101-
"commandLineArgs": "--driver v2net --benchmark"
61+
"commandLineArgs": "--driver windows --benchmark"
10262
},
10363
"WSL: Benchmark All": {
10464
"commandName": "Executable",
10565
"executablePath": "wsl",
10666
"commandLineArgs": "dotnet UICatalog.dll --benchmark",
10767
"distributionName": ""
10868
},
109-
"WSL: Benchmark All --driver v2": {
110-
"commandName": "Executable",
111-
"executablePath": "wsl",
112-
"commandLineArgs": "dotnet UICatalog.dll --driver v2 --benchmark",
113-
"distributionName": ""
114-
},
115-
"WSL: Benchmark All --driver v2unix": {
69+
"WSL: Benchmark All --driver unix": {
11670
"commandName": "Executable",
11771
"executablePath": "wsl",
118-
"commandLineArgs": "dotnet UICatalog.dll --driver v2unix --benchmark",
72+
"commandLineArgs": "dotnet UICatalog.dll --driver unix --benchmark",
11973
"distributionName": ""
12074
},
121-
"WSL: Benchmark All --driver v2net": {
75+
"WSL: Benchmark All --driver dotnet": {
12276
"commandName": "Executable",
12377
"executablePath": "wsl",
124-
"commandLineArgs": "dotnet UICatalog.dll --driver v2net --benchmark",
78+
"commandLineArgs": "dotnet UICatalog.dll --driver dotnet --benchmark",
12579
"distributionName": ""
12680
},
12781
"Docker": {
@@ -135,9 +89,9 @@
13589
"commandName": "Project",
13690
"commandLineArgs": "--disable-cm\r\n"
13791
},
138-
"UICatalog --disable-cm --driver v2win": {
92+
"UICatalog --disable-cm --driver windows": {
13993
"commandName": "Project",
140-
"commandLineArgs": "--disable-cm --driver v2win"
94+
"commandLineArgs": "--disable-cm --driver windows"
14195
},
14296
"Themes": {
14397
"commandName": "Project",

Examples/UICatalog/Scenarios/Images.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ private void SixelViewOnDrawingContent (object sender, DrawEventArgs e)
532532
// Application.Driver?.Move (_screenLocationForSixel.X, _screenLocationForSixel.Y);
533533
// Application.Driver?.AddStr (_encodedSixelData);
534534

535-
// Works in NetDriver but results in screen flicker when moving mouse but vanish instantly
535+
// Works in DotNetDriver but results in screen flicker when moving mouse but vanish instantly
536536
// Console.SetCursorPosition (_screenLocationForSixel.X, _screenLocationForSixel.Y);
537537
// Console.Write (_encodedSixelData);
538538
}

Examples/UICatalog/UICatalog.cs

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using System.Diagnostics.CodeAnalysis;
1919
using System.Globalization;
2020
using System.Reflection;
21+
using System.Reflection.Metadata;
2122
using System.Text;
2223
using System.Text.Json;
2324
using Microsoft.Extensions.Logging;
@@ -76,12 +77,25 @@ private static int Main (string [] args)
7677
// Process command line args
7778

7879
// If no driver is provided, the default driver is used.
79-
Option<string> driverOption = new Option<string> ("--driver", "The IConsoleDriver to use.").FromAmong (
80-
Application.GetDriverTypes ().Item2.ToArray ()!
81-
);
80+
// Get allowed driver names
81+
string? [] allowedDrivers = Application.GetDriverTypes ().Item2.ToArray ();
82+
83+
Option<string> driverOption = new Option<string> ("--driver", "The IConsoleDriver to use.")
84+
.FromAmong (allowedDrivers!);
85+
driverOption.SetDefaultValue (string.Empty);
8286
driverOption.AddAlias ("-d");
8387
driverOption.AddAlias ("--d");
8488

89+
// Add validator separately (not chained)
90+
driverOption.AddValidator (result =>
91+
{
92+
var value = result.GetValueOrDefault<string> ();
93+
if (result.Tokens.Count > 0 && !allowedDrivers.Contains (value))
94+
{
95+
result.ErrorMessage = $"Invalid driver name '{value}'. Allowed values: {string.Join (", ", allowedDrivers)}";
96+
}
97+
});
98+
8599
// Configuration Management
86100
Option<bool> disableConfigManagement = new (
87101
"--disable-cm",
@@ -163,6 +177,17 @@ private static int Main (string [] args)
163177
return 0;
164178
}
165179

180+
var parseResult = parser.Parse (args);
181+
182+
if (parseResult.Errors.Count > 0)
183+
{
184+
foreach (var error in parseResult.Errors)
185+
{
186+
Console.Error.WriteLine (error.Message);
187+
}
188+
return 1; // Non-zero exit code for error
189+
}
190+
166191
Scenario.BenchmarkTimeout = Options.BenchmarkTimeout;
167192

168193
Logging.Logger = CreateLogger ();
@@ -175,16 +200,16 @@ private static int Main (string [] args)
175200
public static LogEventLevel LogLevelToLogEventLevel (LogLevel logLevel)
176201
{
177202
return logLevel switch
178-
{
179-
LogLevel.Trace => LogEventLevel.Verbose,
180-
LogLevel.Debug => LogEventLevel.Debug,
181-
LogLevel.Information => LogEventLevel.Information,
182-
LogLevel.Warning => LogEventLevel.Warning,
183-
LogLevel.Error => LogEventLevel.Error,
184-
LogLevel.Critical => LogEventLevel.Fatal,
185-
LogLevel.None => LogEventLevel.Fatal, // Default to Fatal if None is specified
186-
_ => LogEventLevel.Fatal // Default to Information for any unspecified LogLevel
187-
};
203+
{
204+
LogLevel.Trace => LogEventLevel.Verbose,
205+
LogLevel.Debug => LogEventLevel.Debug,
206+
LogLevel.Information => LogEventLevel.Information,
207+
LogLevel.Warning => LogEventLevel.Warning,
208+
LogLevel.Error => LogEventLevel.Error,
209+
LogLevel.Critical => LogEventLevel.Fatal,
210+
LogLevel.None => LogEventLevel.Fatal, // Default to Fatal if None is specified
211+
_ => LogEventLevel.Fatal // Default to Information for any unspecified LogLevel
212+
};
188213
}
189214

190215
private static ILogger CreateLogger ()

Terminal.Gui/App/Application.Driver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static partial class Application // Driver abstractions
2020

2121
// BUGBUG: ForceDriver should be nullable.
2222
/// <summary>
23-
/// Forces the use of the specified driver (one of "fake", "ansi", "curses", "net", or "windows"). If not
23+
/// Forces the use of the specified driver (one of "fake", "dotnet", "windows", or "unix"). If not
2424
/// specified, the driver is selected based on the platform.
2525
/// </summary>
2626
/// <remarks>

0 commit comments

Comments
 (0)