diff --git a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj index 8497178e6..2143b2810 100644 --- a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj +++ b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs b/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs index c871abef2..c834650ab 100644 --- a/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs +++ b/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs @@ -7,22 +7,14 @@ namespace DiscordChatExporter.Cli.Utils.Extensions { internal static class ConsoleExtensions { - public static IAnsiConsole CreateAnsiConsole(this IConsole console) - { - var ansiConsole = AnsiConsole.Create( - new AnsiConsoleSettings - { - Ansi = AnsiSupport.Detect, - ColorSystem = ColorSystemSupport.Detect, - Out = console.Output - } - ); - - // HACK: https://github.com/spectresystems/spectre.console/pull/318 - ansiConsole.Profile.Encoding = console.Output.Encoding; - - return ansiConsole; - } + public static IAnsiConsole CreateAnsiConsole(this IConsole console) => AnsiConsole.Create( + new AnsiConsoleSettings + { + Ansi = AnsiSupport.Detect, + ColorSystem = ColorSystemSupport.Detect, + Out = new AnsiConsoleOutput(console.Output) + } + ); public static Progress CreateProgressTicker(this IConsole console) => console .CreateAnsiConsole() @@ -30,12 +22,11 @@ public static Progress CreateProgressTicker(this IConsole console) => console .AutoClear(false) .AutoRefresh(true) .HideCompleted(false) - .Columns(new ProgressColumn[] - { + .Columns( new TaskDescriptionColumn {Alignment = Justify.Left}, new ProgressBarColumn(), new PercentageColumn() - }); + ); public static async ValueTask StartTaskAsync( this ProgressContext progressContext,