archway-network / cli

Develop WASM smart contracts with the Archway network developer CLI
https://docs.archway.io
Apache License 2.0
44 stars 21 forks source link

fix(core): gracefully stop running processes on Ctrl+C #260

Closed eliasmpw closed 11 months ago

eliasmpw commented 11 months ago

Closes #246

This fix makes the terminal not hang anymore, but additional work will be necessary to send SIGINT (Ctrl+C) signals to child processes. The SIGINT signal is received by the wrapping script /bin/run, which doesn't have direct access to the process ID of children processes to kill them. A possible solution may be to use an AbortController on any spawned sub-process.

Also, the DockerOptimizer can now listen to the Ctrl+C keypress and kill the running container.