spectreconsole / spectre.console

A .NET library that makes it easier to create beautiful console applications.
https://spectreconsole.net
MIT License
9.09k stars 465 forks source link

Issue with custom progress columns not displaying properly when running from Docker #1292

Open vadysa opened 11 months ago

vadysa commented 11 months ago

Information

Describe the bug When running the C# code using AnsiConsole.Progress() with custom progress columns on both Windows and Linux, it works as expected. However, when running the same code within a Docker container, the custom progress columns do not appear, and it seems to use default settings.

To Reproduce Steps to reproduce the behavior:

1) Run the C# code using AnsiConsole.Progress() with custom progress columns on a Windows or Linux host machine. Observe that the custom columns are displayed correctly. 2) Run the same C# code within a Docker container, and observe that the custom columns are not displayed as expected.

Expected behavior When running the C# code within a Docker container, the custom progress columns should be displayed just like on a Windows or Linux host machine.

Screenshots Windows:
image
Docker:
image

Additional context It appears that there might be an issue or misconfiguration specific to running the code within a Docker container that causes the custom progress columns to not be displayed. Investigating Docker-related configurations and environment settings may be necessary to resolve this issue.

 AnsiConsole.Progress()
             .Columns(new ProgressColumn[]
             {
                new TaskDescriptionColumn(),
                new ProgressBarColumn(),
                new PercentageColumn(),
                new RemainingTimeColumn(),
                new SpinnerColumn(),
                new TransferSpeedColumn(),
             })
             .Start(ctx =>
             {

Please upvote :+1: this issue if you are interested in it.

patriksvensson commented 11 months ago

The docker log output is not an interactive environment so progress and similar will not work, so it falls back to safe rendering. This is by design.

patriksvensson commented 11 months ago

We could however consider making the columns configurable for the fallback renderer as well.

isaacrlevin commented 1 month ago

Jumping on this to see is there are workarounds. Would clearing the previous line be an option? In my case I do want to see progress, but I really don't need things like the spinner or bar, I'm fine with a percentage.