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
Input prompt with command substitution #681
Comments
Interestingly, the bash builtin |
Looks like this is probably solved by #519 But is it possible to write to /dev/tty instead of stderr? |
I don't think you'll be able to write to |
However, this might not be a great idea since I have no idea what the equivalent would be on Windows. |
@kwkelly actually, you can pass any stream as |
I'm trying to write a bash script using inquirer for input, but when using command substitution, inquirer does not show the prompt.
Test script
test.js
To see the problem, try assigning the output of the prompt to a variable.
In a bash shell (maybe others):
ans=$(node test.js)
And nothing shows up, event though simply
node test.js
works just fine.
However, the
read
bash builtin seems to work fine with command substitution. The following will show a prompt:$(read -p "Enter input: " input)
The text was updated successfully, but these errors were encountered: