-
Notifications
You must be signed in to change notification settings - Fork 4
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
Undefined behaviour when piping #139
Comments
Take note of process redirection too. |
Looking into this, It seems commander doesn't do any special handling of input pipes. It piped into That said, It seems that in the case of prompting a new password we end up with a Otherwise, the only thing we really need to consider here is the pipe ending while waiting more input. Or really just throwing a more useful error at this stage than the deadlock error. I'll explore some solutions. |
The only thing that really needs to be fixed for this is the prompt utility functions. The problem is that the utility function awaits the To fix this, wherever we await the |
Sometimes commands expect the usage of Yea if it's expecting to read from prompt then usually piping in from stdin should work too. |
Describe the bug
So it's possible to use the pipe operation to input into a
polykey
command. For example,echo password | npm run polykey -- agent start
. This will actually input the password on the first prompt.If we try and start
Polykey
using a pipe and starting from scratch we end up with a promise deadlock.Trying with a newline has the same problem
My guess is that the pipe closing is causing the problem here.
To Reproduce
echo password | agent start
from fresh stateErrorPolykeyCLIAsynchronousDeadlock
error.Expected behavior
Hard to say, maybe it should input the first password no problem, but still wait for the confirmation input? Is it also possible to include newlines in the password like this? Do we want to support that? Do we need to sanitise password inputs?
Platform (please complete the following information)
Notify maintainers
@tegefaulkes
The text was updated successfully, but these errors were encountered: