Use a proper tty test.

This commit is contained in:
isaacs 2010-11-26 18:33:29 -08:00 committed by Ryan Dahl
parent 6285fac232
commit a52f59b437
2 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,7 @@ function Interface (output, completer) {
this.setPrompt("> ");
this.enabled = output.fd < 3; // Looks like a TTY.
this.enabled = stdio.isatty(output.fd);
if (parseInt(process.env['NODE_NO_READLINE'], 10)) {
this.enabled = false;

View File

@ -1,3 +1,5 @@
// Can't test this when 'make test' doesn't assign a tty to the stdout.
// Yet another use-case for require('tty').spawn ?
common = require("../common");
assert = common.assert;
var readline = require("readline");