@Override
  public void resize(@NotNull TermSize termSize) {
    if (myPtyProcess instanceof PtyProcess ptyProcess) {
      if (ptyProcess.isAlive()) {
        ptyProcess.setWinSize(new WinSize(termSize.getColumns(), termSize.getRows()));
      }
    }
    else if (myPtyProcess instanceof PtyBasedProcess ptyBasedProcess) {
      ptyBasedProcess.setWindowSize(termSize.getColumns(), termSize.getRows());
    }
    else if (myPtyProcess instanceof RemoteProcess remoteProcess) {
      remoteProcess.setWindowSize(termSize.getColumns(), termSize.getRows());
    }
  }
@Override
  public void resize(@NotNull TermSize termSize)