Skip to content

Instantly share code, notes, and snippets.

@moul
Last active August 29, 2015 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moul/f6095744b8c566798c39 to your computer and use it in GitHub Desktop.
Save moul/f6095744b8c566798c39 to your computer and use it in GitHub Desktop.
node-spawn-stdio.js
process.stdout.isTTY;
require('child_process').spawn('ssh', 'localhost -t -- bash'.split(' '), {stdio: 'inherit'});
@moul
Copy link
Author

moul commented Apr 22, 2015

This code redirects:

  • stdin, stdout and stderr on node@0.10.29
  • but only stdin and stderr (no stdout) on node@0.12.0

if I remove process.stdout.isTTY, it works everywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment