From f9da776b332fbb1b7443da3446de9127b98b3d94 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Tue, 13 Mar 2012 11:53:49 -0700 Subject: [PATCH] process: listen for the "exit" even on the main repl --- src/node.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node.js b/src/node.js index 176526a07c9..9dd9fd41950 100644 --- a/src/node.js +++ b/src/node.js @@ -100,6 +100,9 @@ if (NativeModule.require('tty').isatty(0)) { // REPL var repl = Module.requireRepl().start('> ', null, null, true); + repl.on('exit', function() { + process.exit(); + }); } else { // Read all of stdin - execute it.