kill() does not kill correctly
FishingHacks opened this issue · 3 comments
FishingHacks commented
when invoking kill(), it does not kill the child process correctly. This is because the child process is a terminal provider, which invokes ts-node or tsx, which in turn invoke other processes. All these processes dont get killed when the main process gets killed.
Solution:
Precompile the scripts on change using esbuild, so that we just launch node, which we can then kill
FishingHacks commented
Fixed on Linux by spawning with shell just on windows
FishingHacks commented
fixed by using esbuild for compilation on file-change and using fork(...) when running a script.
TODO: Display error when compilation failed
FishingHacks commented
finished todo with commit 4fbc2bd