Starts the Observer GUI. To stop the tool, close the window.
Say no more, so I go ahead and close the window, but the app remains on the dock.
Right click app on dock and click Quit, nothing happens.
Run :observer.start() again now that window is closed, nothing happens.
Force quit the erlang app, I get the following
13:28:01.365 [info] SIGTERM received - shutting down
 70302 killed iex -S mix
Does this mean the erlang macOS app I see in dock is the actual iex session, not the observer? Or does it just mean that iex session process is linked to observer process?
Expected behavior behavior: on window close, tool gets stopped, app removed from dock, iex receives message and keeps running. Then, in same iex session, on second :observer.start() call, tool starts anew with app in dock.
It is because of the architecture of macOS and the limitation that only root PID can create window. So in fact, closing the window didn’t closed the “application” (from the OS point of view) as the PID is still there (ERTS need to do some special-case handling for macOS to make it work).
Just like there are many mac apps out there, which can run without having a window open so can the beam. Opening another observer will simply open a new observer window. Think of observer less like a separate app to your shell, but more like your shell is also a program rendering windows.
Ah, if I do rightclick → Quit then it doesn’t work for me as well. If I just close the observer window itself then I can open new windows. Seems like trying to quit the observer sends the mac application into cleanup mode, which then waits for iex to shut down, which never happens.