New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve default value of the stdin
option with $
#742
Comments
Are there any downsides? |
The only one I can think of is that when using One thing to consider is that $({ stdio: 'inherit' })`command ...` If they don't, this means they are letting the parent print the output, which would work when using Also, even though the child process' |
Ok, let's do it. |
I implemented it with #758. However, it has performance issues. It makes simple commands twice slower.
I don't think there is a way to solve this. There is also the non-interactive TTY issue mentioned above, so I am going to close this issue and try to solve the underlying problem of passing
|
Background
Some commands need their
stdin
to be interactive. For example, script prompts.Other commands need it to be programmatic. For example when:
childProcess.pipeStdout(otherChildProcess)
childProcess.stdin.write()
stream.pipe(childProcess.stdin)
input
orinputFile
optionAnd then many commands allow both, such as most Unix utilities like
cat
,grep
orrg
.Previous default value
Initially, we've started with
$
having the same default value for thestdin
option asexeca()
, i.e."pipe"
.With #548, #549 and #550, we switched the default value to
"inherit"
.New default value
However, with the recent additions to the
stdin
option, we can now have the best of both worlds! We could switch the default value for thestdin
option with$
to['pipe', 'inherit']
instead.This means users would be allowed to use both interactive and programmatic
stdin
.One of the upsides is to be able to use:
Instead of the following, which is currently making piping processes more verbose and error-prone:
It also means users would be able to use
childProcess.stdin.write()
andstream.pipe(childProcess.stdin)
without setting anystdin
option.What do you think?
The text was updated successfully, but these errors were encountered: