Nested Status() and Progress() #1340
Unanswered
AthenaAzuraeaX
asked this question in
Q&A
Replies: 1 comment
-
I too have found a need for this... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I know this isn't supported directly, so I wanted to check if there's an alternate way of making this possible or if there are any plans to add this feature in the future.
What I basically would to do is to mix Status() and Progress(). Say I have a couple of tasks:
Initializing some stuff...
Downloading some files...
Cleaning up...
It would be nice to use Status() for this, but for the second tasks downloading, I'd like to use a Progress to show the progress of the files being downloaded since they can be big.
The only way I can think of doing this is to nest Status() and Progress():
await AnsiConsole .Status() .Spinner(Spinner.Known.Dots) .StartAsync("Running...", RunAsync);
Then inside RunAsync, when downloading files, we would do:
await AnsiConsole .Progress() .AutoClear(true) .HideCompleted(true) .Columns(new ProgressColumn[] { new RemainingTimeColumn() { }, new SpinnerColumn() { Spinner = Spinner.Known.Dots }, new ProgressBarColumn(), new TaskDescriptionColumn(), new PercentageColumn(), new ElapsedTimeColumn() }) .StartAsync(async Context => { // Download files... });
But unfortunately this is not supported. So is there a way to achieve this or are there future plans to improve this?
EDIT: I don't know it's removing whitespace for the code and I don't know how to fix it.
Beta Was this translation helpful? Give feedback.
All reactions