Skip to content

Commit 59b869e

Browse files
committed
Revert "Revert "repl: disable Ctrl+C support..."
Full original message: Revert "repl: disable Ctrl+C support on win32 for now" The original fix was a stop gap until a libuv update landed. As the libuv update has not yet landed on v6.x the revert should not have landed. This commit reverts 1d400ea reapplying the stopgap fix until we update libuv. Fixes: #12085 Refs: #8645 PR-URL: #12123 Reviewed-By: Anna Henningsen <[email protected]>
1 parent 54adf37 commit 59b869e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/repl.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,13 @@ function REPLServer(prompt,
322322
if (!err) {
323323
// Unset raw mode during evaluation so that Ctrl+C raises a signal.
324324
let previouslyInRawMode;
325-
if (self.breakEvalOnSigint) {
325+
326+
// Temporarily disabled on Windows due to output problems that likely
327+
// result from the raw mode switches here, see
328+
// https://github.com/nodejs/node/issues/7837
329+
// Setting NODE_REPL_CTRLC is meant as a temporary opt-in for debugging.
330+
if (self.breakEvalOnSigint &&
331+
(process.platform !== 'win32' || process.env.NODE_REPL_CTRLC)) {
326332
// Start the SIGINT watchdog before entering raw mode so that a very
327333
// quick Ctrl+C doesn’t lead to aborting the process completely.
328334
utilBinding.startSigintWatchdog();
@@ -342,7 +348,8 @@ function REPLServer(prompt,
342348
result = script.runInContext(context, scriptOptions);
343349
}
344350
} finally {
345-
if (self.breakEvalOnSigint) {
351+
if (self.breakEvalOnSigint &&
352+
(process.platform !== 'win32' || process.env.NODE_REPL_CTRLC)) {
346353
// Reset terminal mode to its previous value.
347354
self._setRawMode(previouslyInRawMode);
348355

0 commit comments

Comments
 (0)