markExited method
Records that the process is gone.
The session stays in the list either way. A crashed service is nearly always a compile error the developer is about to fix, and dropping its pane would read as the whole fleet going down.
Implementation
void markExited(int code) {
_exitCode = code;
_state = code == 0 ? ServiceState.stopped : ServiceState.crashed;
_flush(_stdout);
_flush(_stderr);
notifyListeners();
}