Permalink
Browse files

Pipe output directly

Fixes #68.
  • Loading branch information...
1 parent 34c3d6b commit fd105aca34195c91a9fbd6f76be929c396add9f6 @iangreenleaf iangreenleaf committed Sep 10, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/supervisor.js
View
@@ -186,9 +186,12 @@ function help () {
function startProgram (prog, exec) {
util.debug("Starting child process with '" + exec + " " + prog.join(" ") + "'");
crash_queued = false;
- var child = exports.child = spawn(exec, prog);
- child.stdout.addListener("data", function (chunk) { chunk && util.print(chunk); });
- child.stderr.addListener("data", function (chunk) { chunk && util.debug(chunk); });
+ var child = exports.child = spawn(exec, prog, {stdio: 'inherit'});
+ if (child.stdout) {
+ // node < 0.8 doesn't understand the 'inherit' option, so pass through manually
+ child.stdout.addListener("data", function (chunk) { chunk && util.print(chunk); });
+ child.stderr.addListener("data", function (chunk) { chunk && util.debug(chunk); });
+ }
child.addListener("exit", function (code) {
if (!crash_queued) {
util.debug("Program " + exec + " " + prog.join(" ") + " exited with code " + code + "\n");

0 comments on commit fd105ac

Please sign in to comment.