From 1994a7177c60c54f38fdbac045554821b14ac048 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Mon, 15 Jun 2015 09:05:11 -0400 Subject: OTP apps show proper output Whenever the old shell got killed and an app got loaded prior, the whole thing would silently drop output as the old 'user' process was replaced while application master processes would keep the old one's pid in their internal state. To work around this limitation, make sure the apps are booted only after the shell is replaced so that only the new `user` pid is used. --- src/rebar_prv_shell.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index e407ff2..84ad723 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -85,8 +85,11 @@ format_error(Reason) -> shell(State) -> setup_name(State), setup_paths(State), - maybe_boot_apps(State), setup_shell(), + %% apps must be started after the change in shell because otherwise + %% their application masters never gets the new group leader (held in + %% their internal state) + maybe_boot_apps(State), rebar_agent:start_link(State), %% this call never returns (until user quits shell) timer:sleep(infinity). -- cgit v1.1