Browse Source

Use a proper tty test.

v0.7.4-release
isaacs 14 years ago
committed by Ryan Dahl
parent
commit
a52f59b437
  1. 2
      lib/readline.js
  2. 2
      test/disabled/test-readline.js

2
lib/readline.js

@ -40,7 +40,7 @@ function Interface (output, completer) {
this.setPrompt("> "); 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)) { if (parseInt(process.env['NODE_NO_READLINE'], 10)) {
this.enabled = false; this.enabled = false;

2
test/simple/test-readline.js → test/disabled/test-readline.js

@ -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"); common = require("../common");
assert = common.assert; assert = common.assert;
var readline = require("readline"); var readline = require("readline");
Loading…
Cancel
Save