Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[repl] Cannot interrupt executions with Ctrl-C on Windows #221

Open
absop opened this issue Jan 21, 2024 · 0 comments
Open

[repl] Cannot interrupt executions with Ctrl-C on Windows #221

absop opened this issue Jan 21, 2024 · 0 comments

Comments

@absop
Copy link

absop commented Jan 21, 2024

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 (SIGINT or SIGBREAK) 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

image

Screenshot on Linux

image

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();
@absop absop changed the title Cannot interrupt executions with Ctrl-C on Windows [repl] Cannot interrupt executions with Ctrl-C on Windows Jan 22, 2024
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

No branches or pull requests

1 participant