Skip to content

Commit

Permalink
Revert "Revert "repl: disable Ctrl+C support..."
Browse files Browse the repository at this point in the history
Full original message:

  Revert "repl: disable Ctrl+C support on win32 for now"

This reverts commit 1d400ea.
  • Loading branch information
MylesBorins committed Mar 28, 2017
1 parent 6803521 commit 1978911
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,13 @@ function REPLServer(prompt,
if (!err) {
// Unset raw mode during evaluation so that Ctrl+C raises a signal.
let previouslyInRawMode;
if (self.breakEvalOnSigint) {

// Temporarily disabled on Windows due to output problems that likely
// result from the raw mode switches here, see
// https://github.com/nodejs/node/issues/7837
// Setting NODE_REPL_CTRLC is meant as a temporary opt-in for debugging.
if (self.breakEvalOnSigint &&
(process.platform !== 'win32' || process.env.NODE_REPL_CTRLC)) {
// Start the SIGINT watchdog before entering raw mode so that a very
// quick Ctrl+C doesn’t lead to aborting the process completely.
utilBinding.startSigintWatchdog();
Expand All @@ -342,7 +348,8 @@ function REPLServer(prompt,
result = script.runInContext(context, scriptOptions);
}
} finally {
if (self.breakEvalOnSigint) {
if (self.breakEvalOnSigint &&
(process.platform !== 'win32' || process.env.NODE_REPL_CTRLC)) {
// Reset terminal mode to its previous value.
self._setRawMode(previouslyInRawMode);

Expand Down

0 comments on commit 1978911

Please sign in to comment.