Detect if the shell process terminated and restart a new one if so
Fix fragment lifecycles and properly init application state after process termination