Skip to content

Commit

Permalink
repl: disable Ctrl+C support on win32 for now
Browse files Browse the repository at this point in the history
Disable Windows support for interrupting REPL commands using
Ctrl+C by default, because the switches from console raw mode
and back have been interfering with printing the results of
evaluated expressions.

This is a temporary measure, since the underlying problem is
very likely not related to this specific feature.

Ref: nodejs#7837
  • Loading branch information
addaleax committed Aug 4, 2016
1 parent e1643cc commit 3cca703
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ 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
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 @@ -308,7 +313,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 3cca703

Please sign in to comment.