Skip to content

Conversation

addaleax
Copy link
Collaborator

This was previously broken because the async repl implementation
adds an process.on('SIGINT') listener for the duration of the
async part of the evaluation. That listener would interfere with
breaking on sigint if another synchronous evaluation would be
started while it is present.

Fix this by not being lazy anymore and temporarily disabling
existing SIGINT event listeners on both process and repl
(and not just repl). In this case, the “inner” evaluation
also temporarily removes the “outer” SIGINT listener and
can go about as usual.

This was previously broken because the async repl implementation
adds an `process.on('SIGINT')` listener for the duration of the
*async* part of the evaluation. That listener would interfere with
breaking on sigint if another *synchronous* evaluation would be
started while it is present.

Fix this by not being lazy anymore and temporarily disabling
existing `SIGINT` event listeners on both `process` and `repl`
(and not just `repl`). In this case, the “inner” evaluation
also temporarily removes the “outer” `SIGINT` listener and
can go about as usual.
@addaleax addaleax merged commit 1a63e69 into master Mar 18, 2021
@addaleax addaleax deleted the 641-dev branch March 18, 2021 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants