ajalt / mordant

Multiplatform text styling for Kotlin command-line applications
https://ajalt.github.io/mordant/
Apache License 2.0
935 stars 33 forks source link

Cannot get tasks of a `MultiProgressBarAnimation` to update #163

Closed sschuberth closed 4 months ago

sschuberth commented 4 months ago

I'm trying to migrate progress display for downloading (or verifying) files to the new MultiProgressBarAnimation, but the individual task texts stay at the value of the initial context:

Verifying           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━    0%  eta -:--:--
> Package ':::'...                                                                                                    
> Package ':::'...                                                                                                    
> Package ':::'...                                                                                                    
> Package ':::'...                                                                                                    
> Package ':::'...                                                                                                    
> Package ':::'...                                                                                                    
> Package ':::'...                                                                                                    
> Package ':::'...                    

I'm probably doing something stupid with the coroutines, but I'm stuck. Can you assist please?

ajalt commented 4 months ago

You're calling prorgess.execute(), which suspends indefinitely. You need to launch { progress.execute() }

sschuberth commented 4 months ago

Actually, I couldn't use launch as I was also outside of a context 😁 Fixing that gets me further, thanks.