Tyrrrz/CliFx

Executable name does not appear in help text in some terminals

rcdailey opened this issue · 4 comments

I'm using .NET Core 5 and I've compiled a single executable for Ubuntu x64. When I run Command -h via SSH (through MINGW), the executable name does not appear when the help is printed:

image

It looks more like it renders ConsoleColor.DarkGray the same as ConsoleColor.Black. What terminal are you using?

Try to see what the executable name is in code:

var app = new CliApplicationBuilder().Build();

var exeName = app.Metadata.ExecutableName;

Edit: nevermind I see that you use MINGW

Yes, I'm using MINGW (specifically, the one that comes with Git for Windows). I typically use that for SSH into my linux boxes.

Here's my entry point code. I am using NerdBank.GitVersioning to obtain my version number and I set that into CliFx:

internal static class Program
{
    private static IContainer? _container;

    public static async Task<int> Main()
    {
        _container = CompositionRoot.Setup();
        return await new CliApplicationBuilder()
            .AddCommandsFromThisAssembly()
            .SetExecutableName("Trash")
            .SetVersion(ThisAssembly.AssemblyInformationalVersion)
            .UseTypeActivator(type => _container.Resolve(type))
            .Build()
            .RunAsync();
    }
}

I was going to see if there's a mechanism to change the color. Dark gray doesn't look good inside Jetbrains Rider's integrated terminal, either:

image

Any idea on if you can get this fixed? Maybe just add a simple extension method to the CliApplicationBuilder to override the color?

I'd just replace the currently used color with some other one. Nobody is going to bother configuring them on per-application basis, especially if these things look differently in different terminals anyway. Honestly I'm surprised any terminal would allow two different colors blend together like that. In Rider it looks fine for me, but I think it's because I use a different theme from you.

Anyway, let's replace the color. If possible, find some other grayish/misc color that looks good, but if not then just use the default color (avoid specifying it).