From 3f69c711579dbc513915efd558da05170243fcf5 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Mon, 21 May 2012 19:43:26 -0300 Subject: [PATCH] readline: explicitly disable and re-enable "raw mode" on Ctrl+Z Fixes #3295. --- lib/readline.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/readline.js b/lib/readline.js index 2de74397be6..02d15527cd8 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -656,8 +656,13 @@ Interface.prototype._ttyWrite = function(s, key) { self.pause(); self.emit('SIGCONT'); } + // explictly re-enable "raw mode" and move the cursor to the correct + // position. See https://github.com/joyent/node/issues/3295. + self._setRawMode(true); + self._refreshLine(); }; })(this)); + this._setRawMode(false); process.kill(process.pid, 'SIGTSTP'); } break;