Open danieltdp opened 7 years ago
@ManrajGrover maybe one simply needs to initialize that if two spinners are spinning. Then, simply print a new line betweem them?
@bertokhoury It can surely be tried. I was also looking to explore how other libraries do the same thing. listr is one of them. Do let me know if you get a chance to implement your solution. Also, feel free to send a PR for the same. 😄
@ManrajGrover I found that they use list and line counter to push string, render and clear in listr→listr-update-renderer→log-update→ansi-escapes.
How about wrapping frame
in something like output
?
# render
output = ['/ First task', '- Second task', '+ Last task']
stream.write('\n'.join(output))
# output maybe
# / First task
# - Second task
# + Last task
# clear
line_count = len(output)
for i in range(line_count):
stream.write('\r')
stream.write(CLEAR_LINE)
stream.write('\033[1A') # Move the cursor up 1 line
@JungWinter That is such a clever solution! I guess we can support that. We would need to think of a design to accommodate this considering each spinner has its own thread and we would need to get the frame from each spinner before rendering. Let me know if you have already thought about the same.
I would like to work on this issue. @manrajgrover could you assign me on this?
Any updates on this feature? I would like to use something like this
@JustinTervala there seems to be some progress in #155 which implements something similar. Have a look at the PR to see if it meets your requirement.
https://github.com/manrajgrover/halo/pull/155 looks like it would work for me.
Suppose you get multiple long tasks at hand. It should be nice to be able to start more than one spinner before finishing the last one
take this as an example: