Sample Header Ad - 728x90

Inquirer program answer questions by piping

0 votes
0 answers
185 views
Hi I have written this program with inquirer.js it has a list question and after that a text input. I want to answer both questions with piping. If I just keep the list question, I can easily use yes 1 | command and it selects the first option and I'm done. But keeping both questions same command passes the first question just fine but on the text one it would keep blinking 1 forever. Using echo "something" | command surprisingly selects default on the first question and leaves the second one alone, though it doesn't wait for user input it's like it has inputted nothing in there but has pressed enter for both questions really weird. Using yes '' | command doesn't get stuck and behaves exactly as above example. Using yes '1\nhello\n' | command answers the first question fine and the second question keeps blinking between 1 and hello forever. I have no other idea what to do now. Any help would be appreciated.
Asked by Steve Moretz (101 rep)
Apr 27, 2022, 09:53 PM
Last activity: Apr 28, 2022, 05:34 AM