Fix driver name options shown in UICatalog for v2 (#3940)

- v2 auto picks based on OS
- v2win is the new windows interop driver
- v2net is the new dotnet core cross platform driver

Co-authored-by: Tig <tig@users.noreply.github.com>
This commit is contained in:
Thomas Nind
2025-03-02 00:22:55 +00:00
committed by GitHub
parent 98f70b2632
commit 255e5d6643
2 changed files with 7 additions and 5 deletions

View File

@@ -231,14 +231,14 @@ internal class ConsoleDriverFacade<T> : IConsoleDriver, IConsoleDriverFacade
if (InputProcessor is WindowsInputProcessor)
{
type = "(win)";
type = "win";
}
else if (InputProcessor is NetInputProcessor)
{
type = "(net)";
type = "net";
}
return GetType ().Name.TrimEnd ('`', '1') + type;
return "v2" + type;
}
/// <summary>Tests if the specified rune is supported by the driver.</summary>

View File

@@ -147,8 +147,10 @@ public class UICatalogApp
// If no driver is provided, the default driver is used.
Option<string> driverOption = new Option<string> ("--driver", "The IConsoleDriver to use.").FromAmong (
Application.GetDriverTypes ()
.Select (d => d!.Name)
.ToArray ()
.Where (d=>!typeof (IConsoleDriverFacade).IsAssignableFrom (d))
.Select (d => d!.Name)
.Union (["v2","v2win","v2net"])
.ToArray ()
);
driverOption.AddAlias ("-d");
driverOption.AddAlias ("--d");