sindresorhus / np

A better `npm publish`
MIT License
7.56k stars 298 forks source link

Option to not hijack child process streams #136

Closed jamestalmage closed 1 year ago

jamestalmage commented 7 years ago

Writing native-stream-type I ran into a problems with both AVA and np. They both hijack the native streams of the child processes they launch (in AVA it is test workers, in np it's basically everything we launch with execa).

This led me to abandon both AVA for testing and np for publishing (just for that project).

Solving the problem in AVA is tricky (we do lots of manipulation of the child stdio streams), but it seems easier with NP (just abandon the pretty print - and dump really verbose output to the console).

I am not sure this option is necessary for anything but testing (i.e. setting it would only affect the test step).

Implementation should be fairly straightforward. It would mean just using the default stdio: 'inherit' when forking the test process, not using Listr for that step, and then resuming with the pretty Listr output afterwards.

sindresorhus commented 7 years ago

Solving the problem in AVA is tricky (we do lots of manipulation of the child stdio streams)

Let's continue this in https://github.com/avajs/ava/issues/1322.

but it seems easier with NP (just abandon the pretty print - and dump really verbose output to the console).

I've run into this too. Maybe we could use node-pty as an optional dependency to create a pseudo-terminal. That would solve the problem without abandoning the pretty output.

fregante commented 1 year ago

Closing due to age. Listr also hasn't been effectively updated in years so the course of action would be to replace the dependency: