elm-watch doesn't exit when stdin closes
See original GitHub issueIn my use case I spawn elm-watch hot
from my backend app which uses Phoenix. I configure Phoenix using a watcher (https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-runtime-configuration). I am also spawning esbuild
for my other assets in the same way.
When Phoenix exits it signals to the child processes (esbuild
and elm-watch
in my case) that they should also exit by closing stdin
, however, elm-watch
doesn’t exit and is thus left running, so needs to be killed manually.
This is easy to reproduce by running npx elm-watch hot
and then pressing ctrl-d
- this closes stdin
but has no effect on elm-watch
which continues running.
I think this should be the standard behaviour for tools like this as both esbuild
and webpack
terminate from their “watch” mode when stdin
is closed.
I can work around this by wrapping elm-watch
in this script but it would be nice if this was handled directly by elm-watch
.
I tried to fix this, but my JS/Node knowledge is quite basic and I wasn’t able to find the right place in the code to listen for stdin
being closed and exit so unfortunately I cannot offer a PR.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (10 by maintainers)
Top GitHub Comments
Fixed the regression, released 1.1.0-beta.5 with this change. Hoping to release 1.1.0 the coming week.
A new version coming soon! At least a beta. I was going to release it as non-beta, but found a (minor) regression.