I am developing a web application in Phoenix and I also just started discovering Unix process management.
I put my app in background, like this:
vagrant@dev:/srv/my_app$ iex -S mix phoenix.server &
[1] 8726
Then I'd like to cd
to another directory and do some other work in the main prompt. However, as soon as I do that, the background process stops.
vagrant@dev:/srv/my_app$ cd ..
[1]+ Stopped iex -S mix phoenix.server (wd: /srv/my_app)
I noticed this happens only in this particular case, because it's a prompt. It doesn't happen with other non-interactive processes (I'm free to change directory and all of that).
I tried the same with irb
, another prompt, and I get exactly the same behavior.
Why is this happening, and is there any workaround for having a prompt in the background and change directory without it being stopped?
jobs -l
at the shell prompt, it will show the reason for the job being stopped. Is it stopped on tty input, or tty output? – Mark Plotnick Sep 14 '16 at 15:16