Skip to content

Commit 255e5d6

Browse files
tznindtig
andauthored
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>
1 parent 98f70b2 commit 255e5d6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Terminal.Gui/ConsoleDrivers/V2/ConsoleDriverFacade.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ public virtual string GetVersionInfo ()
231231

232232
if (InputProcessor is WindowsInputProcessor)
233233
{
234-
type = "(win)";
234+
type = "win";
235235
}
236236
else if (InputProcessor is NetInputProcessor)
237237
{
238-
type = "(net)";
238+
type = "net";
239239
}
240240

241-
return GetType ().Name.TrimEnd ('`', '1') + type;
241+
return "v2" + type;
242242
}
243243

244244
/// <summary>Tests if the specified rune is supported by the driver.</summary>

UICatalog/UICatalog.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ private static int Main (string [] args)
147147
// If no driver is provided, the default driver is used.
148148
Option<string> driverOption = new Option<string> ("--driver", "The IConsoleDriver to use.").FromAmong (
149149
Application.GetDriverTypes ()
150-
.Select (d => d!.Name)
151-
.ToArray ()
150+
.Where (d=>!typeof (IConsoleDriverFacade).IsAssignableFrom (d))
151+
.Select (d => d!.Name)
152+
.Union (["v2","v2win","v2net"])
153+
.ToArray ()
152154
);
153155
driverOption.AddAlias ("-d");
154156
driverOption.AddAlias ("--d");

0 commit comments

Comments
 (0)