quickjs
quickjs copied to clipboard
[repl] Cannot interrupt executions with Ctrl-C on Windows
The Ctrl-C shortcut does not send a SIGINT signal.
From the Windows console document:
The CTRL+C and CTRL+BREAK key combinations receive special handling by console processes. By default, when a console window has the keyboard focus, CTRL+C or CTRL+BREAK is treated as a signal (
SIGINTorSIGBREAK) and not as keyboard input.
But in the repl of QuickJS, on Windows, press CTRL+C does not send a SIGINT signal to interrupt the execution of time-consuming commands.
Screenshot on Windows
Screenshot on Linux
The code:
function mod7(limit) {
var count = 0;
for (var i = 0; i < limit; i++)
if (i % 7 === 0)
count++;
return count;
}
function test_mod7() {
var s, r, e;
s = Date.now();
r = mod7(1000000000);
e = Date.now();
console.log((e - s) / 1000, r);
}
test_mod7();