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 exit infinite loop with Ctrl+C #2001

Open
martian17 opened this issue Apr 27, 2023 · 1 comment
Open

REPL: Cannot exit infinite loop with Ctrl+C #2001

martian17 opened this issue Apr 27, 2023 · 1 comment

Comments

@martian17
Copy link

martian17 commented Apr 27, 2023

Search Terms

infinite loop
breakEvalOnSigint
break

Expected Behavior

As soon as Ctrl+C is pressed, eval should throw "Uncaught Error: Script execution was interrupted by SIGINT", as in default node.js repl.

Actual Behavior

Loops indefinitely.

Steps to reproduce the problem

Open ts-node repl with ts-node, and type while(1){} and hit enter.

Minimal reproduction

$ ts-node
> while(1){}
// cannot exit

Specifications

  • ts-node version: v10.9.1
  • node version: v18.14.1
  • TypeScript version: v5.0.4
  • tsconfig.json, if you're using one: N/A
  • package.json: N/A
  • Operating system and version: Xubuntu 22.04.2 LTS x86_64
  • If Windows, are you using WSL or WSL2?: N/A
@SalvatorePreviti
Copy link

The problem is that Node does not support passing breakEvalOnSigint with a custom eval function - I don't know if there is a solution but I would be interested in one

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

2 participants