private void initTerminateForkedProcessHandler(@Nullable ProcessHandler processHandler) {
    if (processHandler != null) {
      processHandler.addProcessListener(new ProcessAdapter() {
        @Override
        public void processWillTerminate(@NotNull ProcessEvent event, boolean willBeDestroyed) {
          if (!willBeDestroyed) {
            // always terminate forked process
            terminateForkedProcess(event.getProcessHandler());
          }
        }
      });
    }
  }
private void initTerminateForkedProcessHandler(@Nullable ProcessHandler processHandler)