I tried to add multiple progress bars that run in parallel using coroutines, and it works (mostly), but it prints unwanted newlines.
Here is an example of my code:
val mutex = Mutex()
val jobs = mutableListOf<Job>()
for (i in 0..< 3)
{
val p = terminal.progressAnimation {
text("Test $i...")
percentage()
progressBar()
padding = 0
}
p.updateTotal(30)
p.start()
mutex.withLock {
jobs += launch {
runBlocking {
for (y in 0..<30)
{
p.advance(1)
delay(10)
}
p.stop()
}
}
}
}
jobs.joinAll()
Running this code will result in:
Test 0...100%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test 1...100%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test 2...100%━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Would it be possible to add better control over printing newlines before and after a progress bar?
I tried to add multiple progress bars that run in parallel using coroutines, and it works (mostly), but it prints unwanted newlines. Here is an example of my code:
Running this code will result in:
Would it be possible to add better control over printing newlines before and after a progress bar?