TtyConnector (@NotNull PtyProcess process) { return new PtyProcessTtyConnector(process, myDefaultCharset) { @Override public void close() { 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(); } } @Override public void resize(@NotNull TermSize termSize) { if (LOG.isDebugEnabled()) { LOG.debug("resize to " + termSize); } super.resize(termSize); } }; }