watchexec: Does not detect successful erl command exit

When running erl -s init stop Watchexec hangs indefinitely:

$ time erl -s init stop
Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
________________________________________________________
Executed in    1.13 secs      fish           external
   usr time  121.84 millis   66.00 micros  121.78 millis
   sys time  195.03 millis  850.00 micros  194.19 millis
$ erl -s init stop
Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
$ echo $status
0
$ watchexec -f 'apps/*/src/**.erl' -- erl -s init stop
[Running: erl -s init stop]
^C[Waiting 60s for processes to exit before stopping...]
fish: Job 1, 'watchexec -f 'apps/*/src/**.erl…' terminated by signal SIGKILL (Forced quit)

(The force quit comes from running pkill -9 watchexec in another terminal)

To reproduce, install Erlang using e.g. mise with mise use erlang@26

$ watchexec —version
watchexec 1.25.1 (d3949cc 2024-01-05) +pid1
commit-hash: d3949cc6e9879225ab8191ad558691da97d28a23
commit-date: 2024-01-05
build-date: 2024-01-05
release: 1.25.1
features: default,pid1

macOS Sonoma 14.3.1

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Yes

Hi! It does work, thank you. Sorry, I was wondering if it was a bug or the intended behaviour as I don’t understand what precisely is happening here.

Thank you for your work and for answering my question, I am super grateful! 💜