//
FileInputStream in = new FileInputStream(FileDescriptor.in);
ConsoleReader reader = new ConsoleReader(null, in, out, term);
//
final JLineProcessor processor = new JLineProcessor(ansi, shell, reader, out);
//
InterruptHandler interruptHandler = new InterruptHandler(new Runnable() {
@Override
public void run() {
processor.interrupt();
}
});
interruptHandler.install();
//
Thread thread = new Thread(processor);
thread.setDaemon(true);
thread.start();
//
try {
processor.closed();
}
catch (Throwable t) {
t.printStackTrace();
}
finally {