void () { // if exit code was set on processTerminated, no need to rewrite it // WinPtyProcess returns -2 if pty is already closed if (!myOutput.isExitCodeSet() && myProcessHandler instanceof BaseProcessHandler) { myOutput.setExitCode(((BaseProcessHandler<?>)myProcessHandler).getProcess().exitValue()); } }