Skip to content
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

Unable to pipe yes into a confirmation #170

Open
jgrund opened this issue Feb 3, 2022 · 3 comments
Open

Unable to pipe yes into a confirmation #170

jgrund opened this issue Feb 3, 2022 · 3 comments

Comments

@jgrund
Copy link

jgrund commented Feb 3, 2022

Hi,

When wanting to bypass a confirmation in an automated way, it does not appear possible to use the yes command, I.E:

yes | some_dialoguer_cmd

Will just hang

@ip1981
Copy link

ip1981 commented Feb 3, 2022

Probably it could have a code path for the case when stdin is not a tty.

@sycured
Copy link

sycured commented Apr 1, 2022

@jgrund I used expect and it works

#!/usr/local/bin/expect -f

set timeout -1
spawn ./tests.sh
match_max 100000
expect -exact "Are you sure you want to delete the project key: CITS? \[y/n\] �\[?25l"
send -- "y"
expect eof

My biggest problem was finding the ending "[?25l"

@LeoDog896
Copy link

#82 using rustyline may be able to solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants