Allow rendering stdout data from within tasks by default
0x-r4bbit opened this issue · 4 comments
It seems that, by default, Listr suppresses everything that's being send to stdout from within a task. For example, having a simple console.log()
statement in a task, doesn't actually result in it being rendered in the console.
There are cases where it's useful to have a task change its code path based on user input via stdin using some sort of prompt input. Unfortunately, those don't get rendered either while the task itself does pause and wait for input.
I checked the verbose-renderer and using that one, I do see all output, also the one emitted from within a task. I assume, to get the behaviour I'm looking for, I'd have to build a custom renderer that does what verbose-renderer does, but instead of outputting everything, it would only output what's being emitting from within a task. I don't think that there's a way to distinguish between data and data coming from within a task though.
What would be the most pragmatic way forward here? Is it possible that Listr would just not suppress output from within a task by default?
What would be the most pragmatic way forward here? Is it possible that Listr would just not suppress output from within a task by default?
AFAIK this is by design and for example lint-staged relies on this behavior. You can check out how we're logging errors from stdout
and stderr
Oh nice, good to see that listr-input
does it for you @PascalPrecht !