mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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 1d400ea484 reapplying the
stopgap fix until we update libuv.
Fixes: https://github.com/nodejs/node/issues/12085
Refs: https://github.com/nodejs/node/pull/8645
PR-URL: https://github.com/nodejs/node/pull/12123
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
912f78a566
commit
64fc5a4541
1 file changed
+9
-2
+9
-2
@@ -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();
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user