private @Nullable PtyProcess getPtyProcess() {
    ProcessHandlerTtyConnector phc = ObjectUtils.tryCast(myTerminalWidget.getTtyConnector(), ProcessHandlerTtyConnector.class);
    return phc != null ? phc.getPtyProcess() : null;
  }
private @Nullable PtyProcess getPtyProcess()