summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2012-09-28 10:58:50 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2012-09-28 10:58:50 +0400
commitd68c02e3fe50405279a138e908701558939ce926 (patch)
tree08e3cd22b62e84d26b2df8fa5b34f93cb18429a1 /lib
parent8ac1a73635316024f05375d021344ae2b45db831 (diff)
downloadandroid-node-v8-d68c02e3fe50405279a138e908701558939ce926.tar.gz
android-node-v8-d68c02e3fe50405279a138e908701558939ce926.tar.bz2
android-node-v8-d68c02e3fe50405279a138e908701558939ce926.zip
debugger: test repeating last command
* debugger: Add NODE_FORCE_READLINE environment variable, handle `SIGINT`'s sent to process while in this mode.
Diffstat (limited to 'lib')
-rw-r--r--lib/_debugger.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js
index b221ce0bb9..d719631358 100644
--- a/lib/_debugger.js
+++ b/lib/_debugger.js
@@ -759,6 +759,15 @@ function Interface(stdin, stdout, args) {
};
if (parseInt(process.env['NODE_NO_READLINE'], 10)) {
opts.terminal = false;
+ } else if (parseInt(process.env['NODE_FORCE_READLINE'], 10)) {
+ opts.terminal = true;
+
+ // Emulate Ctrl+C if we're emulating terminal
+ if (!this.stdout.isTTY) {
+ process.on('SIGINT', function() {
+ self.repl.rli.emit('SIGINT');
+ });
+ }
}
if (parseInt(process.env['NODE_DISABLE_COLORS'], 10)) {
opts.useColors = false;
@@ -777,7 +786,6 @@ function Interface(stdin, stdout, args) {
self.killChild();
});
-
var proto = Interface.prototype,
ignored = ['pause', 'resume', 'exitRepl', 'handleBreak',
'requireConnection', 'killChild', 'trySpawn',