Browse Source

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

This reverts commit f59b8888f1
now that the libuv update containing the proper fix has
landed in 63243bcb33.

Ref: https://github.com/libuv/libuv/pull/1054
Ref: https://github.com/nodejs/node/issues/7837
PR-URL: https://github.com/nodejs/node/pull/8645
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
Anna Henningsen 8 years ago
parent
commit
2e2887579f
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 11
      lib/repl.js

11
lib/repl.js

@ -289,13 +289,7 @@ function REPLServer(prompt,
if (!err) { if (!err) {
// Unset raw mode during evaluation so that Ctrl+C raises a signal. // Unset raw mode during evaluation so that Ctrl+C raises a signal.
let previouslyInRawMode; 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 // Start the SIGINT watchdog before entering raw mode so that a very
// quick Ctrl+C doesn’t lead to aborting the process completely. // quick Ctrl+C doesn’t lead to aborting the process completely.
utilBinding.startSigintWatchdog(); utilBinding.startSigintWatchdog();
@ -315,8 +309,7 @@ function REPLServer(prompt,
result = script.runInContext(context, scriptOptions); result = script.runInContext(context, scriptOptions);
} }
} finally { } finally {
if (self.breakEvalOnSigint && if (self.breakEvalOnSigint) {
(process.platform !== 'win32' || process.env.NODE_REPL_CTRLC)) {
// Reset terminal mode to its previous value. // Reset terminal mode to its previous value.
self._setRawMode(previouslyInRawMode); self._setRawMode(previouslyInRawMode);

Loading…
Cancel
Save