summaryrefslogtreecommitdiff
path: root/src/node.js
diff options
context:
space:
mode:
authorNathan Rajlich <nathan@tootallnate.net>2012-03-21 00:05:25 -0700
committerNathan Rajlich <nathan@tootallnate.net>2012-03-21 00:05:25 -0700
commitfeaa8a41c7533c254923ea7333457234ed44f8f9 (patch)
tree7ffa8f0e056576f6ae0f05b938a03cce1a94c88c /src/node.js
parentd2389f8fab22e2ce187551addde3b18730030af5 (diff)
downloadnode-new-feaa8a41c7533c254923ea7333457234ed44f8f9.tar.gz
cmd: add a -i / --interactive flag to force the REPL
This is the only way to spawn a node child process in REPL mode, and will also be needed to be able to use the REPL in MinTTY.
Diffstat (limited to 'src/node.js')
-rw-r--r--src/node.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node.js b/src/node.js
index d0cbc40422..e09465178a 100644
--- a/src/node.js
+++ b/src/node.js
@@ -118,8 +118,8 @@
} else {
var Module = NativeModule.require('module');
- // If stdin is a TTY.
- if (NativeModule.require('tty').isatty(0)) {
+ // If -i or --interactive were passed, or stdin is a TTY.
+ if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
// REPL
var repl = Module.requireRepl().start('> ', null, null, true);
repl.on('exit', function() {