Comments (5)
Probably has to do with how read
is interacting with this internally.
from nexpect.
Going through the Nexpect code looks like everything should be working...
I'm tempted to say this is actually a node child_process
problem, but I'm still digging into getting this example to work using spawn or exec. So far it's leading me to believe that either the bash read
is somehow bypassing stdout
(perhaps it's on stderr
?), bash creates a direct write to the terminal, or Node can't capture certain kinds of output.
from nexpect.
from man bash, for the read command
-p prompt
Display prompt on standard error, without a trailing newline, before attempting to
read any input. The prompt is displayed only if input is coming from a terminal.
So, it seems you should not behaviour in nexpect to be same as when run interactively. nexpect would need overhaul to spawn in pseudo-tty, and Node.js doesn't support such capabilities natively, AFAICT.
from nexpect.
Ok, that certainly explains it.
I remember reading that there was some tty support, but don't know how to make node operate that way: Node TTY or this one to force tty.
Looks like I will be rewriting some bash scripts in node for now, until I figure this out :)
from nexpect.
The node APIs, and force tty are the opposite of what you want, you need node to be a pseudo tty master, see:
http://en.wikipedia.org/wiki/Pseudo-TTY
from nexpect.
Related Issues (16)
- nexpect - CLI hangs HOT 5
- The version in the public registry is out of date HOT 1
- Pulled from git, all tests fail. HOT 2
- Regular expression not supported? HOT 1
- Difference between expect() and wait()? HOT 1
- run() got executed twice? HOT 2
- No color in child output
- Support for interactive programs HOT 7
- Is there any OR possibility? HOT 1
- How to exit a program? HOT 3
- How to use the sendline() method?
- stdout / stderr should be made available to caller in case of error
- `wait` should accept an optional timeout
- Bug: Improper pathname parsing in `nspawn` function HOT 1
- Is it possible to run with Jest?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nexpect.