sindresorhus/ora

Cannot display two spinners at the same time

Opened this issue · 5 comments

Hello, I'm using ora 3.4.0 on MacOS Mojave with Terminal Version 2.9.4 (421.1.1).

It seems I cannot create two spinnners in the same time and handle their progress. Here is the code:

const ora = require('ora');

const one = ora('test1').start();
const two = ora('test2').start();

setTimeout(() => {
  one.text = 'test1 in progress';
  two.text = 'test2 in progress';
}, 1000);

setTimeout(() => {
  one.succeed('test1 finished successfully');
  two.succeed('test2 finished successfully');
}, 2000);

And here is the result:

record

I would expect the first spinner to stay there and not to disappear. Is that by purpose or this is an issue?

Hi @ipeychev! It seems that ora doesn't support multiple spinners. I was struggling with this same problem last week until I found spinnies, another library that supports multiple spinners and has a very similar API. It would be great if there was any plan to support more than one spinner instance at the time in ora!

You may want to use listr: https://www.npmjs.com/package/listr.

Just out of curiosity, is there any discussion regarding if this feature is going to be supported or not?

I'm also curious about this problem