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

Support for interactive programs #14

Open
MarcDiethelm opened this issue Mar 31, 2014 · 7 comments
Open

Support for interactive programs #14

MarcDiethelm opened this issue Mar 31, 2014 · 7 comments

Comments

@MarcDiethelm
Copy link

Unfortunately nexpect seems to be incompatible with interactive cli programs that require user input, e.g. Yeoman. (sendline is not an option here, as I don't know what choices the user will make).

Could this possibly be implemented with Readline?
Also: somewhat relevant SO.

@julianlam
Copy link

Isn't this the entire point of the expect (and by extension, nexpect) program, to run scripts that expect user input, and provide it on demand?

Ironically, the only reason why I'm here is because I can't get my nexpect script to execute against an interactive program...

@akwangho
Copy link

It does not work for me as well in ssh scenario.
The "Password:" prompt can't use consumed after the struggle for several hours.

@boustanihani
Copy link

@akwangho I have the same issue, did you find any solution?

Related: http://stackoverflow.com/questions/24750131/node-js-wait-function-in-nexpect-module-does-not-working

@MarcDiethelm
Copy link
Author

I ended up rolling my own package to solve this problem. https://github.com/MarcDiethelm/superspawn
Works nicely for me.

@boustanihani
Copy link

Thanks.

Does your package provide something similar to wait() ?
https://github.com/nodejitsu/nexpect#function-wait-expectation-callback

@MarcDiethelm
Copy link
Author

Let's not spam this issue with questions concerning a foreign module. If you don't mind please open an issue in my project and we can discuss it there.

@boustanihani
Copy link

you're right :)

gcochard added a commit to gcochard/nexpect that referenced this issue May 4, 2015
This allows nexpect to work with conditional branching. It will
emit 'wait' right now, and the data will be the line of output
which matches the expected output. From there, you can re-test the data
and call sendline, expect, or wait again. Note that the user MUST
call wait BEFORE the end of the stackframe on which the child was spawned.
gcochard added a commit to gcochard/nexpect that referenced this issue May 4, 2015
This allows nexpect to work with conditional branching. It will
emit 'wait' right now, and the data will be the line of output
which matches the expected output. From there, you can re-test the data
and call sendline, expect, or wait again. Note that the user MUST
call wait BEFORE the end of the stackframe on which the child was spawned.
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