final Terminal terminal;
if (interactive) {
terminal = null;/* let jline select an appropriate one */
} else {
// no colors in output
terminal = new UnsupportedTerminal();
}
ConsoleReader consoleReader = new ConsoleReader(in, out, terminal);
consoleReader.setAutoprintThreshold(20);
consoleReader.setPaginationEnabled(interactive);
consoleReader.setHistoryEnabled(interactive);