@Override
    public synchronized void close() {
      try {
        shell.close();
      } catch (Exception ignored) {
      }
      synchronized (callbackThread) {
        callbackThread.notifyAll();
      }
      callbackThread.interrupt();
      callbackThread.quit();
      closed = true;
      if (onCloseListener != null) {
        onCloseListener.onClosed(this);
      }
    }
Closes all resources related to the shell.
imitate/src/main/java/com/engineer/imitate/shell/Shell.java