Quit application when shell process terminates, fixing #3