GithubHelp home page GithubHelp logo

child_pty's Introduction

Enno Boland

freelancer & open source enthusiast, practicing martial arts and bouldering. he/him


If you like my work and want to show gratitude, feel free to buy me a coffee at:

If you like to contract me for OpenSource Consulting, Kubernetes DevOps, or C development, please contact me at

Current projects

child_pty's People

Contributors

friskfly avatar gottox avatar rauchg avatar vlahupetar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

child_pty's Issues

Differences between nodejs spawn and child_pty's spawn

Hi, I'm very interested in porting this to Mozilla to possibly use terminal.js within a mozilla environment. It would be tremendously useful if you could explain what the limitations were that you ran into with nodejs spawn that made you decide to roll your own. Could you give a brief overview?

Thank you!

npm install failing on travis for node >= 4.0

Hey,

For some reason travis seems to be failing a build on my project when building child_pty on node >= 4 (see here: https://travis-ci.org/mike182uk/nodespec/builds/106436805). The error i'm seeing is:

make: Entering directory `/home/travis/build/mike182uk/nodespec/node_modules/child_pty/build'
  CXX(target) Release/obj.target/exechelper/src/exechelper.o
../src/exechelper.cpp: In function ‘int main(int, char**)’:
../src/exechelper.cpp:21:37: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
  LINK(target) Release/exechelper
  CXX(target) Release/obj.target/pty/src/pty.o
In file included from ../src/pty.cpp:1:0:
../node_modules/nan/nan.h:41:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from /home/travis/.node-gyp/4.2.6/include/node/node.h:42:0,
                 from ../node_modules/nan/nan.h:45,
                 from ../src/pty.cpp:1:
/home/travis/.node-gyp/4.2.6/include/node/v8.h:336:1: error: expected unqualified-id before ‘using’
/home/travis/.node-gyp/4.2.6/include/node/v8.h:469:1: error: expected unqualified-id before ‘using’
/home/travis/.node-gyp/4.2.6/include/node/v8.h:852:1: error: expected unqualified-id before ‘using’
In file included from ../node_modules/nan/nan.h:194:0,
                 from ../src/pty.cpp:1:
../node_modules/nan/nan_maybe_43_inl.h:13:1: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:16:1: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:19:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:24:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:31:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:36:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:41:1: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:46:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:51:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:59:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:64:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:69:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:76:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:83:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:91:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:98:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:108:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:114:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:118:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:125:1: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:130:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:135:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:139:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:145:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:150:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:156:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:162:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:168:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:174:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:180:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:186:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:194:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:201:1: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:205:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:209:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:213:12: error: ‘Maybe’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:217:12: error: ‘MaybeLocal’ does not name a type
../node_modules/nan/nan_maybe_43_inl.h:223:12: error: ‘MaybeLocal’ does not name a type
In file included from ../node_modules/nan/nan.h:199:0,

...

Building on travis and node 0.12 works fine.

When i npm install locally (OS X 10.10.5 yosemite) on node >= 4.0 everything seems to work as expected.

Any ideas?

doesn't work on iojs 3.3.0

I've seen similar bugs with other modules (node-inspector just recently fixed a similar bug)

% npm install child_pty                                                                                                                  15-09-06 - 2:45:00

> [email protected] install /Users/petarvlahu/black-screen/node_modules/child_pty
> node-gyp rebuild

  CXX(target) Release/obj.target/exechelper/src/exechelper.o
  LINK(target) Release/exechelper
  CXX(target) Release/obj.target/pty/src/pty.o
In file included from ../src/pty.cpp:1:
../node_modules/nan/nan.h:324:27: error: redefinition of 'NanEnsureHandleOrPersistent'
  NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                          ^
../node_modules/nan/nan.h:319:17: note: previous definition is here
  v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                ^
../node_modules/nan/nan.h:344:27: error: redefinition of 'NanEnsureLocal'
  NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                          ^
../node_modules/nan/nan.h:334:27: note: previous definition is here
  NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                          ^
../node_modules/nan/nan.h:757:13: error: no member named 'smalloc' in namespace 'node'
    , node::smalloc::FreeCallback callback
      ~~~~~~^
../node_modules/nan/nan.h:768:12: error: no matching function for call to 'New'
    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
           ^~~~~~~~~~~~~~~~~
/Users/petarvlahu/.node-gyp/3.3.0/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion from 'uint32_t'
      (aka 'unsigned int') to 'enum encoding' for 3rd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/petarvlahu/.node-gyp/3.3.0/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument ('const char *') would lose const
      qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
/Users/petarvlahu/.node-gyp/3.3.0/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
                                       ^
/Users/petarvlahu/.node-gyp/3.3.0/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                       ^
In file included from ../src/pty.cpp:1:
../node_modules/nan/nan.h:772:12: error: no viable conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from
      'v8::MaybeLocal<v8::Object>' to 'const v8::Local<v8::Object> &' for 1st argument
class Local {
      ^
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from
      'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&' for 1st argument
class Local {
      ^
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal'
  V8_INLINE Local(Local<S> that)
            ^
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:327:13: note: candidate template ignored: could not match 'S *' against 'v8::MaybeLocal<v8::Object>'
  V8_INLINE Local(S* that)
            ^
In file included from ../src/pty.cpp:1:
../node_modules/nan/nan.h:779:26: error: no member named 'Use' in namespace 'node::Buffer'
    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
           ~~~~~~~~~~~~~~^
In file included from ../src/pty.cpp:1:
In file included from ../node_modules/nan/nan.h:24:
In file included from /Users/petarvlahu/.node-gyp/3.3.0/include/node/node.h:42:
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:221:5: error: assigning to 'v8::Primitive *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:501:12: note: in instantiation of function template specialization 'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                             ^
In file included from ../src/pty.cpp:1:
In file included from ../node_modules/nan/nan.h:24:
In file included from /Users/petarvlahu/.node-gyp/3.3.0/include/node/node.h:42:
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:221:5: error: assigning to 'v8::Boolean *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:511:12: note: in instantiation of function template specialization 'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
           ^
../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                             ^
In file included from ../src/pty.cpp:1:
In file included from ../node_modules/nan/nan.h:24:
In file included from /Users/petarvlahu/.node-gyp/3.3.0/include/node/node.h:42:
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:221:5: error: assigning to 'v8::Function *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1645:12: note: in instantiation of function template specialization 'v8::Local<v8::Function>::Local<v8::Value>' requested here
    return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
           ^
../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                             ^
In file included from ../src/pty.cpp:1:
In file included from ../node_modules/nan/nan.h:24:
In file included from /Users/petarvlahu/.node-gyp/3.3.0/include/node/node.h:42:
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:221:5: error: assigning to 'v8::Object *volatile' from incompatible type 'v8::Value *'
    TYPE_CHECK(T, S);
    ^~~~~~~~~~~~~~~~
/Users/petarvlahu/.node-gyp/3.3.0/include/node/v8.h:180:37: note: expanded from macro 'TYPE_CHECK'
    *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                    ^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1776:12: note: in instantiation of function template specialization 'v8::Local<v8::Object>::Local<v8::Value>' requested here
    return NanEscapeScope(
           ^
../node_modules/nan/nan.h:483:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                             ^
10 errors generated.
make: *** [Release/obj.target/pty/src/pty.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/petarvlahu/black-screen/node_modules/child_pty
gyp ERR! node -v v3.3.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "child_pty"
npm ERR! node v3.3.0
npm ERR! npm  v2.13.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the child_pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls child_pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/petarvlahu/black-screen/npm-debug.log

released version does not have callback in close

This makes an error like this show up: (node:865) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

The fix in 6586b6 is on master, which is off of 3.0.4, 3.0.8's what's released, and doesn't have the fix.

At any rate, I'm just curious about why there is so much divergence here. Thanks

ERR_INVALID_CALLBACK

Hi, when I call var pty = child_pty.spawn('ls', []);
I aways got ERR_INVALID_CALLBACK error, I have deploy the node JS on AWS container.
Have some one can look on this?

fs.js:167
throw new ERR_INVALID_CALLBACK();
^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:167:11)
at Object.fs.close (fs.js:540:20)
at Object.module.exports.spawn (/app/dv-webterm/node_modules/child_pty/lib/child_pty.js:95:5)
at Socket. (/app/app.js:54:24)
at Socket.onstream (/app/node_modules/socket.io-stream/lib/socket.js:184:14)
at Socket.emit (events.js:182:13)
at Socket. (/app/node_modules/component-bind/index.js:21:15)
at Socket.emit (events.js:182:13)
at /app/dv-webterm/node_modules/socket.io/lib/socket.js:503:12
at process._tickCallback (internal/process/next_tick.js:61:11)

Failing install

$ uname -a
Darwin Asterisk.home 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
$ npm install child_pty
...
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the child_pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs child_pty
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls child_pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/samadivk/Documents/Programming/Playground/node-webterm/npm-debug.log

Here's the full output: npm-debug.log.txt

Setting stdin to pipe fails..

It looks like something is wrong here. When stdio: ['pipe', 'pty', 'pty'] I got error EFAULT.

	// set up message receiver on the client
	child.stdio.pop().once('data', function(data) {
		var err, errno = - data.readInt32BE(0);
		if(util._errnoException)
			err = util._errnoException(errno, 'spawn ' + command);
		else
			err = new Error('spawn ' + command + ' ' + errno);
		err.path = command;
		err.spawnargs = args.slice(2);
		child.emit('error', err);
		child.removeAllListeners();
		child.kill();
	});

no exit after running tests

With stable node mocha doesn't exit after running tests. This usually means that there are some dangling resources that are not cleaned up correctly.

child error events not being emitted?

When I spawn "definitelyverynotacommand" using child_process, the child emits the following error:

{ [Error: spawn verydefinitelynotacommand ENOENT]
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn verydefinitelynotacommand',
  path: 'verydefinitelynotacommand' }

When I spawn the same with child_pty, the data event listener is triggered with the following output, but there is no error listener triggered:

execvp: No such file or directory

Are there plans to emit error events a la child_process?

data written to stdin is echoed on stdout

Given the sample code:

var child = pty.spawn('node', ['--interactive'])

child.stdout.on('data', function(data){
    console.log('stdout: '+data)
})

child.stdin.write('process.exit()\n')

I get the following output:

stdout: process.exit()

stdout: 
stdout: 
stdout: > 
stdout: p
stdout: r
stdout: o
stdout: ces
stdout: s
stdout: .
stdout: e
stdout: xi
stdout: t
stdout: (
stdout: )
stdout: 

Whereas with the same code using child_process instead of , I only see the prompt as stdout:

stdout: > 

It looks like stdin is being mirrored across the stdout stream. Is that expected behavior for child_pty?

Deprecation Warning

Hello.
Thanks for child_pty.
It's the best among the others that can be found via npm.
I get an deprecation warning and i was wondering if you could fix it.
Thanks!

[DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
at makeCallback (fs.js:127:12)
at Object.fs.close (fs.js:607:20)
at Object.module.exports.spawn (/home/tasoss/tsat/StreamManager/Scanner/node_modules/child_pty/lib/child_pty.js:95:5)

child.stdout not emitting `end` or `close`

end and close event listeners for child.stdout are not being fired when the streams are closed. Sample code that produces the issue:

var child = pty.spawn('echo', ['hello'])
child.stdout.on('end', function(){
    console.log('child stdout end')
})
child.stdout.on('close', function(){
    console.log('child stdout close')
})

I can produce the issue on my Mac (10.10.5), my TravisCI builds fail (Ubuntu 12.04.5 LTS) and I can replicate the issue with my CentOS 7.1 dev box.

npm install error

MacOS EI

> [email protected] install /Users/FX/Source/node-automate-examples/node_modules/child_pty
> node-gyp rebuild

  CXX(target) Release/obj.target/exechelper/src/exechelper.o
  LINK(target) Release/exechelper
  CXX(target) Release/obj.target/pty/src/pty.o
../src/pty.cpp:15:12: fatal error: '/usr/include/util.h' file not found
#               include </usr/include/util.h>
                        ^
1 error generated.
make: *** [Release/obj.target/pty/src/pty.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:88:13)
gyp ERR! stack     at ChildProcess.emit (events.js:173:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/FX/Source/node-automate-examples/node_modules/child_pty
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

Doesn't work with Atom-shell / Electron

Hi,

If it try the example in the README.md, I got this strange error:

$ ./node_modules/electron-prebuilt/dist/electron test.js 
[17962:0515/172530:ERROR:browser_main_loop.cc(171)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
App threw an error when running [Error: Module did not self-register.]
A JavaScript error occured in the browser process
Uncaught Exception:
Error: Module did not self-register.
    at Error (native)
    at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:134:20)
    at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:134:20)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:298:12)
    at Module.require (module.js:353:17)
    at require (module.js:372:17)
    at Object.<anonymous> (/home/cedric/inside/soulserv/tterm/node_modules/child_pty/lib/child_pty.js:1:73)
    at Module._compile (module.js:418:26)
    at Object.Module._extensions..js (module.js:436:10)

In fact, just requiring the lib cause this.

I believe Electron use IO.js.

Here is the process.versions:

{ http_parser: '2.3.0',
  node: '1.6.3',
  v8: '4.2.77.15',
  uv: '1.4.2',
  zlib: '1.2.8',
  ares: '1.10.0-DEV',
  modules: '43',
  openssl: '1.0.1m',
  electron: '0.26.0',
  'atom-shell': '0.26.0',
  chrome: '42.0.2311.107' }

Any idea?

node crash on Heroku

Let me know if I can provide any other useful information!
--Bob

~/node_modules/child_pty $ npm test

> [email protected] test /app/node_modules/child_pty
> jshint lib test && mocha



  child_pty.spawn()


#
# Fatal error in ../deps/v8/src/api.h, line 297
# CHECK(allow_empty_handle || that != __null) failed
#


==== Stack trace ============================================

Security context: 0x3b029906b71 <JS Object>#0#
    1: spawn [/app/node_modules/child_pty/lib/child_pty.js:22] (this=0x3a30d7e9e3a9 <an Object>#1#,command=0x1f4bbfe39209 <String[4]: node>,args=0x3a30d7ee3ef9 <JS Array[1]>#2#,options=0x3b029904121 <undefined>)
    2: arguments adaptor frame: 2->3
    3: spawn_client [/app/node_modules/child_pty/test/test.js:7] (this=0x3b029906c91 <JS Global Object>#3#)
    4: /* anonymous */ [/app/node_modules/child_pty/test/test.js:13] (this=0x3a30d7ec5301 <JS Object>#4#,done=0x3a30d7ee3da9 <JS Function>#5#)
    5: run [/app/node_modules/child_pty/node_modules/mocha/lib/runnable.js:217] (this=0x3a30d7ec6261 <a Test>#6#,fn=0x3a30d7ee1e91 <JS Function>#7#)
    6: runTest [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:373] (this=0x3a30d7ecf479 <a Runner>#8#,fn=0x3a30d7ee1e91 <JS Function>#7#)
    7: /* anonymous */ [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:451] (this=0x3b029906c91 <JS Global Object>#3#,err=0x3b029904121 <undefined>,errSuite=0x3b029904121 <undefined>)
    8: arguments adaptor frame: 0->2
    9: next [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:298] (this=0x3b029906c91 <JS Global Object>#3#,suite=0x3b029904121 <undefined>)
   10: /* anonymous */ [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:308] (this=0x3b029906c91 <JS Global Object>#3#,err=0x3b029904121 <undefined>)
   11: arguments adaptor frame: 0->1
   12: next [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:246] (this=0x3b029906c91 <JS Global Object>#3#,i=0)
   13: _onImmediate [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:275] (this=0x3a30d7ee1dc9 <an Object>#9#)
   14: _immediateCallback(aka processImmediate) [timers.js:345] (this=0x1d80a8b46079 <a process>#10#)

==== Details ================================================

[1]: spawn [/app/node_modules/child_pty/lib/child_pty.js:22] (this=0x3a30d7e9e3a9 <an Object>#1#,command=0x1f4bbfe39209 <String[4]: node>,args=0x3a30d7ee3ef9 <JS Array[1]>#2#,options=0x3b029904121 <undefined>) {
  // stack-allocated locals
  var size = 0x3a30d7ee4089 <an Object>#11#
  // expression stack (top to bottom)
  [03] : 0x1d80a8baa3b9 <JS Function>#12#
  [02] : 0x3a30d7ee4089 <an Object>#11#
  [01] : 0x3a30d7ea4b71 <an Object>#13#
--------- s o u r c e   c o d e ---------
function (command, args, options) {??var size = { cols: 80, rows: 24 };??if(!util.isArray(args)) {???options = args;???args = [];??}??if(options)???extend(size, options.size);??term = pty.open(size);??options = extend({}, options, {???stdio: [ term.slave, term.slave, term.slave ],???detached: true??});??args...

-----------------------------------------
}

[2]: arguments adaptor frame: 2->3 {
  // actual arguments
  [00] : 0x1f4bbfe39209 <String[4]: node>
  [01] : 0x3a30d7ee3ef9 <JS Array[1]>#2#
}

[3]: spawn_client [/app/node_modules/child_pty/test/test.js:7] (this=0x3b029906c91 <JS Global Object>#3#) {
  // stack-allocated locals
  var arguments = 0x3a30d7ee3e29 <an Arguments>#14#
  // expression stack (top to bottom)
  [03] : 0x3a30d7ee3ef9 <JS Array[1]>#2#
  [02] : 0x1f4bbfe39209 <String[4]: node>
  [01] : 0x3a30d7e9e3a9 <an Object>#1#
--------- s o u r c e   c o d e ---------
function spawn_client() {???child = child_pty.spawn(process.argv[0],????Array.prototype.concat.apply([ __dirname + '/libexec/client.js'],????   arguments));??}
-----------------------------------------
}

[4]: /* anonymous */ [/app/node_modules/child_pty/test/test.js:13] (this=0x3a30d7ec5301 <JS Object>#4#,done=0x3a30d7ee3da9 <JS Function>#5#) {
  // heap-allocated locals
  var done = 0x3a30d7ee3da9 <JS Function>#5#
  // expression stack (top to bottom)
  [01] : 0x3b029906c91 <JS Global Object>#3#
  [00] : 0x3a30d7ec61b1 <JS Function spawn_client>#15#
--------- s o u r c e   c o d e ---------
function (done){???spawn_client();????child.on('exit', function() {????done();???});??}
-----------------------------------------
}

[5]: run [/app/node_modules/child_pty/node_modules/mocha/lib/runnable.js:217] (this=0x3a30d7ec6261 <a Test>#6#,fn=0x3a30d7ee1e91 <JS Function>#7#) {
  // stack-allocated locals
  var callFn = 0x3a30d7ee2389 <JS Function callFn>#16#
  // heap-allocated locals
  var fn = 0x3a30d7ee1e91 <JS Function>#7#
  var self = 0x3a30d7ec6261 <a Test>#6#
  var start = 0x3a30d7ee23d1 <a Date>#17#
  var ctx = 0x3a30d7ec5301 <JS Object>#4#
  var finished = 0x3b029904121 <undefined>
  var emitted = 0x3b029904121 <undefined>
  var multiple = 0x3a30d7ee22f9 <JS Function multiple>#18#
  var done = 0x3a30d7ee2341 <JS Function done>#19#
  // expression stack (top to bottom)
  [07] : 0x3a30d7ee3da9 <JS Function>#5#
  [06] : 0x3a30d7ec5301 <JS Object>#4#
--------- s o u r c e   c o d e ---------
function (fn){?  var self = this?    , start = new Date?    , ctx = this.ctx?    , finished?    , emitted;??  // Some times the ctx exists but it is not runnable?  if (ctx && ctx.runnable) ctx.runnable(this);??  // called multiple times?  function multiple(err) {?    if (emitted) return;?    emitted = true;?...

-----------------------------------------
}

[6]: runTest [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:373] (this=0x3a30d7ecf479 <a Runner>#8#,fn=0x3a30d7ee1e91 <JS Function>#7#) {
  // heap-allocated locals
  var test = 0x3a30d7ec6261 <a Test>#6#
  var self = 0x3a30d7ecf479 <a Runner>#8#
  // expression stack (top to bottom)
  [06] : 0x3a30d7ee1e91 <JS Function>#7#
  [05] : 0x3a30d7ec6261 <a Test>#6#
--------- s o u r c e   c o d e ---------
function (fn){?  var test = this.test?    , self = this;??  if (this.asyncOnly) test.asyncOnly = true;??  try {?    test.on('error', function(err){?      self.fail(test, err);?    });?    test.run(fn);?  } catch (err) {?    fn(err);?  }?}
-----------------------------------------
}

[7]: /* anonymous */ [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:451] (this=0x3b029906c91 <JS Global Object>#3#,err=0x3b029904121 <undefined>,errSuite=0x3b029904121 <undefined>) {
  // expression stack (top to bottom)
  [01] : 0x3a30d7ee1e91 <JS Function>#7#
  [00] : 0x3a30d7ecf479 <a Runner>#8#
--------- s o u r c e   c o d e ---------
function (err, errSuite){??      if (err) return hookErr(err, errSuite, false);??      self.currentRunnable = self.test;?      self.runTest(function(err){?        test = self.test;??        if (err) {?          self.fail(test, err);?          self.emit('test end', test);?          return self.hookUp('afterEa...

-----------------------------------------
}

[8]: arguments adaptor frame: 0->2 {
}

[9]: next [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:298] (this=0x3b029906c91 <JS Global Object>#3#,suite=0x3b029904121 <undefined>) {
  // expression stack (top to bottom)
  [01] : 0x3b029906c91 <JS Global Object>#3#
  [00] : 0x3a30d7ee1541 <JS Function>#20#
--------- s o u r c e   c o d e ---------
function next(suite) {?    self.suite = suite;??    if (!suite) {?      self.suite = orig;?      return fn();?    }??    self.hook(name, function(err){?      if (err) {?        var errSuite = self.suite;?        self.suite = orig;?        return fn(err, errSuite);?      }??      next(suites.pop());?    });?  }
-----------------------------------------
}

[10]: /* anonymous */ [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:308] (this=0x3b029906c91 <JS Global Object>#3#,err=0x3b029904121 <undefined>) {
  // stack-allocated locals
  var errSuite = 0x3b029904121 <undefined>
  // expression stack (top to bottom)
  [03] : 0x3b029904121 <undefined>
  [02] : 0x3b029906c91 <JS Global Object>#3#
  [01] : 0x3a30d7ee1771 <JS Function next>#21#
--------- s o u r c e   c o d e ---------
function (err){?      if (err) {?        var errSuite = self.suite;?        self.suite = orig;?        return fn(err, errSuite);?      }??      next(suites.pop());?    }
-----------------------------------------
}

[11]: arguments adaptor frame: 0->1 {
}

[12]: next [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:246] (this=0x3b029906c91 <JS Global Object>#3#,i=0) {
  // heap-allocated locals
  var i = 0
  var hook = 0x3b029904121 <undefined>
  // expression stack (top to bottom)
  [01] : 0x3b029906c91 <JS Global Object>#3#
  [00] : 0x3a30d7ee1b81 <JS Function>#22#
--------- s o u r c e   c o d e ---------
function next(i) {?    var hook = hooks[i];?    if (!hook) return fn();?    if (self.failures && suite.bail()) return fn();?    self.currentRunnable = hook;??    hook.ctx.currentTest = self.test;??    self.emit('hook', hook);??    hook.on('error', function(err){?      self.failHook(hook, err);?    });??    hook....

-----------------------------------------
}

[13]: _onImmediate [/app/node_modules/child_pty/node_modules/mocha/lib/runner.js:275] (this=0x3a30d7ee1dc9 <an Object>#9#) {
  // expression stack (top to bottom)
  [02] : 0
  [01] : 0x3b029906c91 <JS Global Object>#3#
  [00] : 0x3a30d7ee1c21 <JS Function next>#23#
--------- s o u r c e   c o d e ---------
function (){?    next(0);?  }
-----------------------------------------
}

[14]: _immediateCallback(aka processImmediate) [timers.js:345] (this=0x1d80a8b46079 <a process>#10#) {
  // stack-allocated locals
  var immediate = 0x3a30d7ee1dc9 <an Object>#9#
  // expression stack (top to bottom)
  [01] : 0x3a30d7ee1dc9 <an Object>#9#
--------- s o u r c e   c o d e ---------
function processImmediate() {?  var immediate = L.shift(immediateQueue);??  if (L.isEmpty(immediateQueue)) {?    process._needImmediateCallback = false;?  }??  if (immediate._onImmediate) {?    if (immediate.domain) immediate.domain.enter();??    immediate._onImmediate();??    if (immediate.domain) immediate.domain.exit();?...

-----------------------------------------
}

==== Key         ============================================

 #0# 0x3b029906b71: 0x3b029906b71 <JS Object>
 #1# 0x3a30d7e9e3a9: 0x3a30d7e9e3a9 <an Object>
 #2# 0x3a30d7ee3ef9: 0x3a30d7ee3ef9 <JS Array[1]>
                 0: 0x3a30d7ee3ed1 <String[50]: /app/node_modules/child_pty/test/libexec/client.js>
 #3# 0x3b029906c91: 0x3b029906c91 <JS Global Object>
 #4# 0x3a30d7ec5301: 0x3a30d7ec5301 <JS Object>
         _runnable: 0x3a30d7ec6261 <a Test>#6#
              test: 0x3a30d7ec6261 <a Test>#6#
 #5# 0x3a30d7ee3da9: 0x3a30d7ee3da9 <JS Function>
 #6# 0x3a30d7ec6261: 0x3a30d7ec6261 <a Test>
             title: 0x1f4bbfe90e41 <String[11]: should exit>
             async: 1
              sync: 0x3b029904161 <false>
          _timeout: 2000
             _slow: 75
   _enableTimeouts: 0x3b029904141 <true>
          timedOut: 0x3b029904161 <false>
            _trace: 0x3a30d7ec66e1 <an Error>#24#
           pending: 0x3b029904161 <false>
              type: 0x11739c019e99 <String[4]: test>
              file: 0x3a30d7e8ca59 <String[40]: /app/node_modules/child_pty/test/test.js>
            parent: 0x3a30d7ec51d1 <a Suite>#25#
               ctx: 0x3a30d7ec5301 <JS Object>#4#
           _events: 0x3a30d7ee1f61 <an Object>#26#
             timer: 0x3a30d7ee2899 <JS Object>#27#
 #7# 0x3a30d7ee1e91: 0x3a30d7ee1e91 <JS Function>
 #8# 0x3a30d7ecf479: 0x3a30d7ecf479 <a Runner>
          _globals: 0x3a30d7ed3001 <JS Array[38]>#28#
            _abort: 0x3b029904161 <false>
             suite: 0x3a30d7ec51d1 <a Suite>#25#
             total: 5
          failures: 0
           _events: 0x3a30d7ecf949 <an Object>#29#
             _grep: 0x3a30d7ecfd99 <JS RegExp>#30#
           _invert: 0x3b029904121 <undefined>
             stats: 0x3a30d7ed1769 <an Object>#31#
       ignoreLeaks: 0x3b029904141 <true>
         asyncOnly: 0x3b029904121 <undefined>
              next: 0x3a30d7ee0fd1 <JS Function next>#32#
              test: 0x3a30d7ec6261 <a Test>#6#
   currentRunnable: 0x3a30d7ec6261 <a Test>#6#
 #9# 0x3a30d7ee1dc9: 0x3a30d7ee1dc9 <an Object>
         _idleNext: 0x3b029904101 <null>
         _idlePrev: 0x3b029904101 <null>
      _onImmediate: 0x3a30d7ee1c91 <JS Function>#33#
 #10# 0x1d80a8b46079: 0x1d80a8b46079 <a process>
 #11# 0x3a30d7ee4089: 0x3a30d7ee4089 <an Object>
              cols: 80
              rows: 24
 #12# 0x1d80a8baa3b9: 0x1d80a8baa3b9 <JS Function>
 #13# 0x3a30d7ea4b71: 0x3a30d7ea4b71 <an Object>
 #14# 0x3a30d7ee3e29: 0x3a30d7ee3e29 <an Arguments>
            length: 0
            callee: 0x3a30d7ec61b1 <JS Function spawn_client>#15#
 #15# 0x3a30d7ec61b1: 0x3a30d7ec61b1 <JS Function spawn_client>
 #16# 0x3a30d7ee2389: 0x3a30d7ee2389 <JS Function callFn>
 #17# 0x3a30d7ee23d1: 0x3a30d7ee23d1 <a Date>
 #18# 0x3a30d7ee22f9: 0x3a30d7ee22f9 <JS Function multiple>
 #19# 0x3a30d7ee2341: 0x3a30d7ee2341 <JS Function done>
 #20# 0x3a30d7ee1541: 0x3a30d7ee1541 <JS Function>
 #21# 0x3a30d7ee1771: 0x3a30d7ee1771 <JS Function next>
 #22# 0x3a30d7ee1b81: 0x3a30d7ee1b81 <JS Function>
 #23# 0x3a30d7ee1c21: 0x3a30d7ee1c21 <JS Function next>
 #24# 0x3a30d7ec66e1: 0x3a30d7ec66e1 <an Error>
         arguments: 0x3b029904121 <undefined>
              type: 0x3b029904121 <undefined>
           message: 0x1f4bbfe5dc39 <String[28]: done() called multiple times>
 #25# 0x3a30d7ec51d1: 0x3a30d7ec51d1 <a Suite>
             title: 0x1f4bbfe90db9 <String[17]: child_pty.spawn()>
               ctx: 0x3a30d7ec5301 <JS Object>#4#
            suites: 0x3a30d7ec5339 <JS Array[0]>#34#
             tests: 0x3a30d7ec5379 <JS Array[5]>#35#
           pending: 0x3b029904161 <false>
       _beforeEach: 0x3a30d7ec53d9 <JS Array[0]>#36#
        _beforeAll: 0x3a30d7ec5419 <JS Array[0]>#37#
        _afterEach: 0x3a30d7ec5459 <JS Array[1]>#38#
         _afterAll: 0x3a30d7ec5499 <JS Array[0]>#39#
              root: 0x3b029904161 <false>
          _timeout: 2000
   _enableTimeouts: 0x3b029904141 <true>
             _slow: 75
             _bail: 0x3b029904121 <undefined>
            parent: 0x3a30d7e66ea1 <a Suite>#40#
              file: 0x3a30d7e8ca59 <String[40]: /app/node_modules/child_pty/test/test.js>
           _events: 0x3a30d7ec7ea1 <an Object>#41#
 #26# 0x3a30d7ee1f61: 0x3a30d7ee1f61 <an Object>
 #27# 0x3a30d7ee2899: 0x3a30d7ee2899 <JS Object>
      _idleTimeout: 2000
         _idlePrev: 0x3a30d7ee3619 <a Timer>#42#
         _idleNext: 0x3a30d7ee3619 <a Timer>#42#
        _idleStart: 0x3a30d7ee3589 <Number: 1416439555848>
_monotonicStartTime: 672345633
        _onTimeout: 0x3a30d7ee26f1 <JS Function>#43#
           _repeat: 0x3b029904161 <false>
 #28# 0x3a30d7ed3001: 0x3a30d7ed3001 <JS Array[38]>
                 0: 0x1f4bbfe36209 <String[11]: ArrayBuffer>
                 1: 0x1f4bbfe362a1 <String[9]: Int8Array>
                 2: 0x1f4bbfe36161 <String[10]: Uint8Array>
                 3: 0x1f4bbfe36189 <String[17]: Uint8ClampedArray>
                 4: 0x1f4bbfe361b9 <String[10]: Int16Array>
                 5: 0x1f4bbfe36279 <String[11]: Uint16Array>
                 6: 0x1f4bbfe36251 <String[10]: Int32Array>
                 7: 0x1f4bbfe361e1 <String[11]: Uint32Array>
                 8: 0x1f4bbfe36139 <String[12]: Float32Array>
                 9: 0x1f4bbfe36111 <String[12]: Float64Array>
                  ...
 #29# 0x3a30d7ecf949: 0x3a30d7ecf949 <an Object>
          test end: 0x3a30d7ed1bd9 <JS Array[2]>#44#
             start: 0x3a30d7ed2121 <JS Array[2]>#45#
             suite: 0x3a30d7ed22a9 <JS Array[2]>#46#
              pass: 0x3a30d7ed27d9 <JS Array[2]>#47#
              fail: 0x3a30d7ed2979 <JS Array[2]>#48#
               end: 0x3a30d7ed2c19 <JS Array[3]>#49#
           pending: 0x3a30d7ed25f9 <JS Array[2]>#50#
 #30# 0x3a30d7ecfd99: 0x3a30d7ecfd99 <JS RegExp>
            source: 0x1f4bbfe933f1 <String[2]: .*>
            global: 0x3b029904161 <false>
        ignoreCase: 0x3b029904161 <false>
         multiline: 0x3b029904161 <false>
         lastIndex: 0
 #31# 0x3a30d7ed1769: 0x3a30d7ed1769 <an Object>
            suites: 1
             tests: 0
            passes: 0
           pending: 0
          failures: 0
             start: 0x3a30d7ed3589 <a Date>#51#
 #32# 0x3a30d7ee0fd1: 0x3a30d7ee0fd1 <JS Function next>
 #33# 0x3a30d7ee1c91: 0x3a30d7ee1c91 <JS Function>
 #34# 0x3a30d7ec5339: 0x3a30d7ec5339 <JS Array[0]>
 #35# 0x3a30d7ec5379: 0x3a30d7ec5379 <JS Array[5]>
                 0: 0x3a30d7ec6261 <a Test>#6#
                 1: 0x3a30d7ec7f71 <a Test>#52#
                 2: 0x3a30d7ec9e01 <a Test>#53#
                 3: 0x3a30d7ecb331 <a Test>#54#
                 4: 0x3a30d7ecc5f1 <a Test>#55#
 #36# 0x3a30d7ec53d9: 0x3a30d7ec53d9 <JS Array[0]>
 #37# 0x3a30d7ec5419: 0x3a30d7ec5419 <JS Array[0]>
 #38# 0x3a30d7ec5459: 0x3a30d7ec5459 <JS Array[1]>
                 0: 0x3a30d7ecd8b1 <a Hook>#56#
 #39# 0x3a30d7ec5499: 0x3a30d7ec5499 <JS Array[0]>
 #40# 0x3a30d7e66ea1: 0x3a30d7e66ea1 <a Suite>
             title: 0x11739c004501 <String[0]: >
               ctx: 0x3a30d7e67009 <JS Object>#57#
            suites: 0x3a30d7e67101 <JS Array[1]>#58#
             tests: 0x3a30d7e671c9 <JS Array[0]>#59#
           pending: 0x3b029904161 <false>
       _beforeEach: 0x3a30d7e67379 <JS Array[0]>#60#
        _beforeAll: 0x3a30d7e673d9 <JS Array[0]>#61#
        _afterEach: 0x3a30d7e67531 <JS Array[0]>#62#
         _afterAll: 0x3a30d7e67591 <JS Array[0]>#63#
              root: 0x3b029904141 <true>
          _timeout: 2000
   _enableTimeouts: 0x3b029904141 <true>
             _slow: 75
             _bail: 0x3b029904121 <undefined>
           _events: 0x3a30d7e688e1 <an Object>#64#
 #41# 0x3a30d7ec7ea1: 0x3a30d7ec7ea1 <an Object>
 #42# 0x3a30d7ee3619: 0x3a30d7ee3619 <a Timer>
         _idleNext: 0x3a30d7ee2899 <JS Object>#27#
         _idlePrev: 0x3a30d7ee2899 <JS Object>#27#
             msecs: 2000
 #43# 0x3a30d7ee26f1: 0x3a30d7ee26f1 <JS Function>
 #44# 0x3a30d7ed1bd9: 0x3a30d7ed1bd9 <JS Array[2]>
                 0: 0x3a30d7ecf8e1 <JS Function>#65#
                 1: 0x3a30d7ed1b71 <JS Function>#66#
 #45# 0x3a30d7ed2121: 0x3a30d7ed2121 <JS Array[2]>
                 0: 0x3a30d7ed1959 <JS Function>#67#
                 1: 0x3a30d7ed20b9 <JS Function>#68#
 #46# 0x3a30d7ed22a9: 0x3a30d7ed22a9 <JS Array[2]>
                 0: 0x3a30d7ed1a69 <JS Function>#69#
                 1: 0x3a30d7ed2241 <JS Function>#70#
 #47# 0x3a30d7ed27d9: 0x3a30d7ed27d9 <JS Array[2]>
                 0: 0x3a30d7ed1cf1 <JS Function>#71#
                 1: 0x3a30d7ed2771 <JS Function>#72#
 #48# 0x3a30d7ed2979: 0x3a30d7ed2979 <JS Array[2]>
                 0: 0x3a30d7ed1e29 <JS Function>#73#
                 1: 0x3a30d7ed2911 <JS Function>#74#
 #49# 0x3a30d7ed2c19: 0x3a30d7ed2c19 <JS Array[3]>
                 0: 0x3a30d7ed1eb1 <JS Function>#75#
                 1: 0x3a30d7ed2ae9 <JS Function>#76#
                 2: 0x3a30d7ed3271 <JS Function>#77#
 #50# 0x3a30d7ed25f9: 0x3a30d7ed25f9 <JS Array[2]>
                 0: 0x3a30d7ed2031 <JS Function>#78#
                 1: 0x3a30d7ed2591 <JS Function>#79#
 #51# 0x3a30d7ed3589: 0x3a30d7ed3589 <a Date>
 #52# 0x3a30d7ec7f71: 0x3a30d7ec7f71 <a Test>
             title: 0x1f4bbfe90e69 <String[22]: should print to stdout>
                fn: 0x3a30d7ec7ef9 <JS Function>#80#
             async: 1
              sync: 0x3b029904161 <false>
          _timeout: 2000
             _slow: 75
   _enableTimeouts: 0x3b029904141 <true>
          timedOut: 0x3b029904161 <false>
            _trace: 0x3a30d7ec83d9 <an Error>#81#
           pending: 0x3b029904161 <false>
              type: 0x11739c019e99 <String[4]: test>
              file: 0x3a30d7e8ca59 <String[40]: /app/node_modules/child_pty/test/test.js>
            parent: 0x3a30d7ec51d1 <a Suite>#25#
               ctx: 0x3a30d7ec5301 <JS Object>#4#
 #53# 0x3a30d7ec9e01: 0x3a30d7ec9e01 <a Test>
             title: 0x1f4bbfe90ee9 <String[22]: should read from stdin>
                fn: 0x3a30d7ec9db9 <JS Function>#82#
             async: 1
              sync: 0x3b029904161 <false>
          _timeout: 2000
             _slow: 75
   _enableTimeouts: 0x3b029904141 <true>
          timedOut: 0x3b029904161 <false>
            _trace: 0x3a30d7ec9f59 <an Error>#83#
           pending: 0x3b029904161 <false>
              type: 0x11739c019e99 <String[4]: test>
              file: 0x3a30d7e8ca59 <String[40]: /app/node_modules/child_pty/test/test.js>
            parent: 0x3a30d7ec51d1 <a Suite>#25#
               ctx: 0x3a30d7ec5301 <JS Object>#4#
 #54# 0x3a30d7ecb331: 0x3a30d7ecb331 <a Test>
             title: 0x1f4bbfe90fb1 <String[27]: should fire event on resize>
                fn: 0x3a30d7ecb2c9 <JS Function>#84#
             async: 1
              sync: 0x3b029904161 <false>
          _timeout: 2000
             _slow: 75
   _enableTimeouts: 0x3b029904141 <true>
          timedOut: 0x3b029904161 <false>
            _trace: 0x3a30d7ecb399 <an Error>#85#
           pending: 0x3b029904161 <false>
              type: 0x11739c019e99 <String[4]: test>
              file: 0x3a30d7e8ca59 <String[40]: /app/node_modules/child_pty/test/test.js>
            parent: 0x3a30d7ec51d1 <a Suite>#25#
               ctx: 0x3a30d7ec5301 <JS Object>#4#
 #55# 0x3a30d7ecc5f1: 0x3a30d7ecc5f1 <a Test>
             title: 0x1f4bbfe91039 <String[30]: should send sigwinch on resize>
                fn: 0x3a30d7ecc5a9 <JS Function>#86#
             async: 1
              sync: 0x3b029904161 <false>
          _timeout: 2000
             _slow: 75
   _enableTimeouts: 0x3b029904141 <true>
          timedOut: 0x3b029904161 <false>
            _trace: 0x3a30d7ecc659 <an Error>#87#
           pending: 0x3b029904161 <false>
              type: 0x11739c019e99 <String[4]: test>
              file: 0x3a30d7e8ca59 <String[40]: /app/node_modules/child_pty/test/test.js>
            parent: 0x3a30d7ec51d1 <a Suite>#25#
               ctx: 0x3a30d7ec5301 <JS Object>#4#
 #56# 0x3a30d7ecd8b1: 0x3a30d7ecd8b1 <a Hook>
             title: 0x1f4bbfe5d609 <String[17]: "after each" hook>
             async: 0
              sync: 0x3b029904141 <true>
          _timeout: 2000
             _slow: 75
   _enableTimeouts: 0x3b029904141 <true>
          timedOut: 0x3b029904161 <false>
            _trace: 0x3a30d7ecdd49 <an Error>#88#
              type: 0x1f4bbfe5d591 <String[4]: hook>
            parent: 0x3a30d7ec51d1 <a Suite>#25#
               ctx: 0x3a30d7ec5301 <JS Object>#4#
 #57# 0x3a30d7e67009: 0x3a30d7e67009 <JS Object>
 #58# 0x3a30d7e67101: 0x3a30d7e67101 <JS Array[1]>
                 0: 0x3a30d7ec51d1 <a Suite>#25#
 #59# 0x3a30d7e671c9: 0x3a30d7e671c9 <JS Array[0]>
 #60# 0x3a30d7e67379: 0x3a30d7e67379 <JS Array[0]>
 #61# 0x3a30d7e673d9: 0x3a30d7e673d9 <JS Array[0]>
 #62# 0x3a30d7e67531: 0x3a30d7e67531 <JS Array[0]>
 #63# 0x3a30d7e67591: 0x3a30d7e67591 <JS Array[0]>
 #64# 0x3a30d7e688e1: 0x3a30d7e688e1 <an Object>
       pre-require: 0x3a30d7e6c069 <JS Array[3]>#89#
 #65# 0x3a30d7ecf8e1: 0x3a30d7ecf8e1 <JS Function>
 #66# 0x3a30d7ed1b71: 0x3a30d7ed1b71 <JS Function>
 #67# 0x3a30d7ed1959: 0x3a30d7ed1959 <JS Function>
 #68# 0x3a30d7ed20b9: 0x3a30d7ed20b9 <JS Function>
 #69# 0x3a30d7ed1a69: 0x3a30d7ed1a69 <JS Function>
 #70# 0x3a30d7ed2241: 0x3a30d7ed2241 <JS Function>
 #71# 0x3a30d7ed1cf1: 0x3a30d7ed1cf1 <JS Function>
 #72# 0x3a30d7ed2771: 0x3a30d7ed2771 <JS Function>
 #73# 0x3a30d7ed1e29: 0x3a30d7ed1e29 <JS Function>
 #74# 0x3a30d7ed2911: 0x3a30d7ed2911 <JS Function>
 #75# 0x3a30d7ed1eb1: 0x3a30d7ed1eb1 <JS Function>
 #76# 0x3a30d7ed2ae9: 0x3a30d7ed2ae9 <JS Function>
            length: 0
 #77# 0x3a30d7ed3271: 0x3a30d7ed3271 <JS Function>
 #78# 0x3a30d7ed2031: 0x3a30d7ed2031 <JS Function>
 #79# 0x3a30d7ed2591: 0x3a30d7ed2591 <JS Function>
 #80# 0x3a30d7ec7ef9: 0x3a30d7ec7ef9 <JS Function>
 #81# 0x3a30d7ec83d9: 0x3a30d7ec83d9 <an Error>
         arguments: 0x3b029904121 <undefined>
              type: 0x3b029904121 <undefined>
           message: 0x1f4bbfe5dc39 <String[28]: done() called multiple times>
 #82# 0x3a30d7ec9db9: 0x3a30d7ec9db9 <JS Function>
 #83# 0x3a30d7ec9f59: 0x3a30d7ec9f59 <an Error>
         arguments: 0x3b029904121 <undefined>
              type: 0x3b029904121 <undefined>
           message: 0x1f4bbfe5dc39 <String[28]: done() called multiple times>
 #84# 0x3a30d7ecb2c9: 0x3a30d7ecb2c9 <JS Function>
 #85# 0x3a30d7ecb399: 0x3a30d7ecb399 <an Error>
         arguments: 0x3b029904121 <undefined>
              type: 0x3b029904121 <undefined>
           message: 0x1f4bbfe5dc39 <String[28]: done() called multiple times>
 #86# 0x3a30d7ecc5a9: 0x3a30d7ecc5a9 <JS Function>
 #87# 0x3a30d7ecc659: 0x3a30d7ecc659 <an Error>
         arguments: 0x3b029904121 <undefined>
              type: 0x3b029904121 <undefined>
           message: 0x1f4bbfe5dc39 <String[28]: done() called multiple times>
 #88# 0x3a30d7ecdd49: 0x3a30d7ecdd49 <an Error>
         arguments: 0x3b029904121 <undefined>
              type: 0x3b029904121 <undefined>
           message: 0x1f4bbfe5dc39 <String[28]: done() called multiple times>
 #89# 0x3a30d7e6c069: 0x3a30d7e6c069 <JS Array[3]>
                 0: 0x3a30d7e68861 <JS Function>#90#
                 1: 0x3a30d7e6bfc1 <JS Function>#91#
                 2: 0x3a30d7e86e79 <JS Function>#92#
 #90# 0x3a30d7e68861: 0x3a30d7e68861 <JS Function>
 #91# 0x3a30d7e6bfc1: 0x3a30d7e6bfc1 <JS Function>
 #92# 0x3a30d7e86e79: 0x3a30d7e86e79 <JS Function>
=====================

Trace/breakpoint trap
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0
$ npm ls
[email protected] /app/node_modules/child_pty
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └─┬ [email protected]
│ │     ├── [email protected]
│ │     └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ └─┬ [email protected]
│   └── [email protected]
└── [email protected]
$ node -v
v0.10.33
$ uname -a
Linux 06334020-18bb-4b30-9790-c959e89778ff 3.8.11-ec2 #6 SMP Tue Jul 22 22:02:15 UTC 2014 x86_64 GNU/Linux

Failed to install child_pty on MacOS 10.12.3

When I tried to install child_pty on mac os I got below error. The node version is v7.2.0.

$ npm install child_pty
⸨░░░░░░░░░░░░░░░░░░⸩ ⠙ normalizeTree: sill install loadCurrentTree
⸨ ░░░░░░░░░░░░░░░⸩ ⠦ cloneCurrentTree: sill cloneCurrentTree Finishing
⸨ ░░░░░░░░░░░░░░⸩ ⠼ fetchMetadata: sill mapToRegistry uri https://registry.npmjs.org/nan
⸨ ░░░░░⸩ ⠼ extract:child_pty: sill doParallel extract 5

[email protected] install /Users/joey/dev/nodejs/ptydemo/node_modules/termios
node-gyp rebuild

CXX(target) Release/obj.target/termios/src/termios.o

SOLINK_MODULE(target) Release/termios.node

[email protected] install /Users/joey/dev/nodejs/ptydemo/node_modules/child_pty
node-gyp rebuild

CXX(target) Release/obj.target/exechelper/src/exechelper.o
LINK(target) Release/exechelper
CXX(target) Release/obj.target/pty/src/pty.o
../src/pty.cpp:66:11: error: use of undeclared identifier 'ttyname'; did you mean 'ptsname'?
(tty = ttyname(slave)) == NULL)
^~~~~~~
ptsname
/usr/include/stdlib.h:218:7: note: 'ptsname' declared here
char *ptsname(int);
^

encoding

when encoding: 'utf8' is passed to the spawn options, it is ignored and the output is a buffer...
not sure if this was intended?

`end` event emitted twice

Hi @Gottox, first of all, thanks for this great lib.

When I write exit to console the end event is emitted twice. Is that intended behaviour?

Windows support

Hello, here's what I get when i execute npm install :

gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs
node_modules\npm\bin\npm-cli.js" "install" "child_pty"
npm ERR! node v4.2.6
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the child_pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls child_pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Sherlock\Desktop\MyResume\node-webterm\node_modules\npm-de
bug.log

node v8.10.0 error

Hello.
After a few months i ran one project of mine.
I'm using child_pty and i get

tasoss@devtrans:~/nodetest$ node a.js
node[21184]: ../src/pipe_wrap.cc:131:static void node::PipeWrap::New(const v8::FunctionCallbackInfov8::Value&): Assertion `args[0]->IsInt32()' failed.
1: node::Abort() [node]
2: 0x11e77db [node]
3: node::PipeWrap::New(v8::FunctionCallbackInfov8::Value const&) [node]
4: v8::internal::FunctionCallbackArguments::Call(void ()(v8::FunctionCallbackInfov8::Value const&)) [node]
5: 0xb7a2cf [node]
6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate
) [node]
7: 0x39bafe8042fd
Aborted (core dumped)

I don't know if it's related to nodejs/node#12152
Is there any chance to correct it because i use child_pty on some major parts of my app.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.