code: public static Terminal get(Terminal terminal, boolean preExists) throws Exception {
          if (UnixTerminal.class.isAssignableFrom(terminal.getClass())) {
              return new JlEditUnixTerminal((UnixTerminal) terminal, preExists);
          } else if (WindowsTerminal.class.isAssignableFrom(terminal.getClass())) {
              return new JlEditWindowsTerminal((AnsiWindowsTerminal) terminal, preExists);
          } else {
              return terminal;
          }
      }
docs: Wraps a {@link Terminal}.
  @param terminal
  @param preExists
  @return
  @throws Exception