You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched existing issues before opening this one to avoid duplicates
I'm able to reproduce this issue and prove it with a minimal reproduction
I understand this is not a place to ask for free debugging support
Problem
You have a file called file.ts with an infinite loop in it like while(true){}.
By running tsx file.ts you won't be able to stop the execution of tsx by sending a SIGINT (for example with CTRL+C) and the process will run indefinitely until it receives another signal like a SIGQUIT or a SIGSTOP.
The main issue that this behaviour created to me was that, by defining a script in a package.json like "scripts": { "test": "tsx file.ts" } where file.ts would run an infinite loop, after executing it with pnpm test if I sent a couple of SIGINT by keyboard shortcut the script would quit... but the child process spawned by tsx was still running in the background, eating 100% cpu and draining the battery of my laptop.
Precheck
Problem
You have a file called
file.ts
with an infinite loop in it likewhile(true){}
.By running
tsx file.ts
you won't be able to stop the execution of tsx by sending a SIGINT (for example with CTRL+C) and the process will run indefinitely until it receives another signal like a SIGQUIT or a SIGSTOP.Expected behavior
tsx should stop the execution after the SIGINT.
Minimal reproduction URL
https://stackblitz.com/edit/node-fc7ukf?file=index.ts
Version
v4.1.3
Node.js version
v20.7.0
Package manager
pnpm
Operating system
macOS
Contributions
The text was updated successfully, but these errors were encountered: