void () { if (process instanceof UnixPtyProcess) { ((UnixPtyProcess)process).hangup(); AppExecutorUtil.getAppScheduledExecutorService().schedule(() -> { if (process.isAlive()) { LOG.info("Terminal hasn't been terminated by SIGHUP, performing default termination"); process.destroy(); } }, 1000, TimeUnit.MILLISECONDS); } else { process.destroy(); } }